Last active
July 3, 2017 10:59
-
-
Save P0huber/21265a3611eee2b458d468c7d44cb31e to your computer and use it in GitHub Desktop.
Создание полотна 10х10 из букв. The creation of letter canvas 10x10 [Java]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CanvasOfLetters { | |
private static String whileCycle(String s){ | |
int a = 1; | |
while (a < 10) {//The creating of row containing 10 letters "S" | |
System.out.print(s); | |
a++; | |
}return s; | |
} | |
public static void main(String[] args) throws Exception { | |
int a = 1; | |
while(a < 11) {//The cycle of creation tabulation of 10 rows | |
System.out.println(whileCycle("S"));//10 calls of the method with argument "S" | |
a++; | |
} | |
} | |
} | |
/*Гадание на долларовый счет | |
Вывести на экран квадрат из 10х10 букв S используя цикл while. | |
Буквы в каждой строке не разделять. | |
Пример вывода на экран: | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
SSSSSSSSSS | |
Требования: | |
1. Программа не должна считывать текст c клавиатуры. | |
2. Программа должна выводить текст на экран. | |
3. Программа должна выводить квадрат из 10х10 букв S | |
4. В программе должен использоваться цикл while.*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment