День добрый.
Входные:
Строка
4
На выходе
Строка
Строка
Строка
Строка
Пишет, что строк не 4.... Как так?
package com.javarush.task.pro.task04.task0414;
import java.util.Scanner;
/* Хорошего не бывает много */
public class Solution {
public static void main(String[] args) {
String sotr="";
int number = 0;
Scanner console = new Scanner(System.in);
for (int o=0;o<2;o++) {
if (console.hasNextInt())
{ number=console.nextInt(); }
else { sotr=console.nextLine(); }
}
boolean cicle=((number>0)&&(number<5));
int m=0;
do {System.out.println(sotr);
m++;
if (!cicle) break;
}
while (m<number);
}
}