Skip to content

Commit

Permalink
feat(4.5.1): Finish U4_L5_Activity_One
Browse files Browse the repository at this point in the history
  • Loading branch information
101zh committed Nov 1, 2023
1 parent 0a992d9 commit 7ebc81f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/Unit4/U4_L5_Activity_One.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package Unit4;

import java.util.Scanner;

public class U4_L5_Activity_One {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Input a String");
String word = scanner.nextLine();
System.out.println("Input an Inteager");
int times = scanner.nextInt();

for (int i = 0; i < word.length(); i++) {
for (int j = 0; j < times; j++) {
System.out.print(word.substring(i, i + 1));
}
}
scanner.close();

}
}

0 comments on commit 7ebc81f

Please sign in to comment.