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 1820. Ural Steaks

why it is wrong ? (JAVA)
Posted by shaihin 9 Nov 2012 18:40
import java.util.*;
public class Bifshteks      //zadacha -1820
{ int n; int k; int clock;
   public static void main(String args[])
    {
Bifshteks b = new Bifshteks();
Scanner in = new Scanner(System.in);
System.out.println("Skolko bifshteksov zakazat? - ");
b.n = in.nextInt();
while(b.n > 1000 || b.n<0 )
 {System.out.println("Skajite zanovo . Vam Skolko bifshteksov zakazat? - ");
    b.n = in.nextInt();
     }
System.out.println("Skolko bifshteksov mojet gotovitsia odnoremenno? - ");
    b.k = in.nextInt();
      int y = b.n/b.k;
   int x = b.n-(y*b.k);
   if(x==0) y+=0;
   else y+=1;
   System.out.println("Vaw zakaz budet gotov cherez "+y*2+" minut.");
    }
}
Re: why it is wrong ? (JAVA)
Posted by W1nneR 27 May 2013 23:42
Обратите внимание на постановку задачи:
"В единственной строке через пробел записаны целые числа n и k (1 ≤ n, k ≤ 1000)."

В Вашем случае одновременно 2 целых числа ввести нельзя.