|
|
back to boardwhy it is wrong ? (JAVA) 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 целых числа ввести нельзя. |
|
|