repl.it
@CarterMonkey/

JavaCoderGames2

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
  Scanner in = new Scanner(System.in);
  System.out.println("Enter a word");
  String word=in.next();
  char one=word.charAt(0);
  System.out.print(one);
   char two=word.charAt(1);
   for (int i=0; i<2; i++){
     System.out.print(two);
   }

   char three=word.charAt(2);
   for (int i=0; i<3; i++){
     System.out.print(three);
   }
  
  char four=word.charAt(3);
  for (int i=0; i<4; i++){
    System.out.print(four);
   }
  char five=word.charAt(4);
  for (int i=0; i<5; i++){
    System.out.print(five);
  }
  }
}