Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.test.level04.lesson10.task03;
- import java.io.BufferedReader;
- import java.io.InputStreamReader;
- /* Хорошего не бывает много
- Ввести с клавиатуры строку и число N.
- Вывести на экран строку N раз используя цикл while.
- Пример ввода:
- абв
- 2
- Пример вывода:
- абв
- абв
- */
- public class Solution
- {
- public static void main(String[] args) throws Exception
- {
- //Напишите тут ваш код
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String s1 = reader.readLine();
- int num1 = Integer.parseInt(reader.readLine());
- int i = 0;
- while (i<num1) {
- System.out.println(s1);
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement