Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class zadacha4 {
- public static void main(String[] args) {
- //начин 1
- for (int i = 1; i <= 10; i++) {
- System.out.println(repeatStr("*", i));
- }
- }
- //начин 1
- //System.out.println("*");
- //System.out.println("**");
- //System.out.println("***");
- //System.out.println("****");
- //System.out.println("*****");
- //System.out.println("******");
- //System.out.println("*******");
- // System.out.println("********");
- //System.out.println("*********");
- // System.out.println("**********");
- static String repeatStr(String str, int count) {
- String text = "";
- {
- for (int j = 0; j < count; j++) {
- text = text + str;
- }
- }
- return text;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement