Advertisement
desislava_topuzakova

Untitled

Jan 11th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class фсдф {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. int n = Integer.parseInt(scanner.nextLine());
  9.  
  10. String firstAndLastRow = "";
  11.  
  12. firstAndLastRow = repeatText("*", n);
  13. System.out.println(firstAndLastRow);
  14.  
  15.  
  16. }
  17.  
  18. static String repeatText(String textToRepeat, int count) {
  19. String text = "";
  20. for (int i = 0; i < count; i++) {
  21. text = text + textToRepeat;
  22. }
  23. return text;
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement