ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1607. Taxi

what's a problem?
Posted by badion 18 Mar 2013 15:13
import java.util.*;
public class Taxi {


    public static void main(String[] args) {

        int a, b, c, d;

    Scanner rc = new Scanner(System.in);
            System.out.println("Введите стартовую сумму клиента: ");
    a = rc.nextInt();
            System.out.println("Введите стартовую сумму водителя: ");
    c = rc.nextInt();
            System.out.println("Введите сумму, на которую клиент повышает: ");
    b = rc.nextInt();
            System.out.println("Введите сумму, на которую водитель понижает: ");
    d = rc.nextInt();

while (a < c){

    a+=b;
    c-=d;
}


    System.out.println("Сумма, на которой они сошлись: "+a);


}

    }


у меня всё нормально работает, а ихний компилятор бракует... что не правильно?

Edited by author 18.03.2013 15:14

Edited by author 18.03.2013 15:14
Re: what's a problem?
Posted by Andrew Sboev [USU] 18 Mar 2013 20:13
Didn't you read this topic? http://acm.timus.ru/help.aspx?topic=judge
Also, you algorithm is wrong.

Edited by author 18.03.2013 20:13
Re: what's a problem?
Posted by badion 18 Mar 2013 22:00
actually i have read this topic yesterday,
but i still don't understand, what i do wrong...
Andrew Sboev [USU] wrote 18 March 2013 20:13
Didn't you read this topic? http://acm.timus.ru/help.aspx?topic=judge
Also, you algorithm is wrong.

Edited by author 18.03.2013 20:13
Re: what's a problem?
Posted by Andrew Sboev [USU] 18 Mar 2013 22:42
System.out.println("Введите стартовую сумму клиента: ");

Such lines of code are extra, Timus checker thinks that it is an answer for task, and check it - but it is wrong :) So, don't put such lines in your programs.
Re: what's a problem?
Posted by badion 18 Mar 2013 23:40
ok.. look. I erased all "extra lines". but this code does not compiling too...
sorry for my silly questions, but i'm a newbie on this site and i need to understand what i did wrong..


import java.util.*;
public class car {


    public static void main(String[] args) {


    Scanner rc = new Scanner(System.in);

                int a = rc.nextInt();
            int c = rc.nextInt();
        int b = rc.nextInt();
    int d = rc.nextInt();
while (a < c){

    a+=b;
    c-=d;
}
    System.out.print(a);

}
    }