Task: | Merkkijono |
Sender: | user2874 |
Submission time: | 2021-10-12 09:09:54 +0300 |
Language: | Java |
Status: | COMPILE ERROR |
Compiler report
input/Main.java:6: error: cannot find symbol apu2 = 0; ^ symbol: variable apu2 location: class Main input/Main.java:7: error: cannot find symbol String eka = a; ^ symbol: variable a location: class Main input/Main.java:8: error: cannot find symbol while(apu2<apu+1){ ^ symbol: variable apu2 location: class Main input/Main.java:30: error: cannot find symbol apu2++; ^ symbol: variable apu2 location: class Main 4 errors
Code
import java.util.Scanner; public class Main { public static void main (String [] args){ Scanner lukija = new Scanner(System.in); int apu = Integer.valueOf(lukija.nextLine()); apu2 = 0; String eka = a; while(apu2<apu+1){ if(apu == 1){ eka = "b" + eka + "b"; } if(apu == 2){ eka = "c" + eka + "c"; } if(apu == 3){ eka = "d" + eka + "d"; } if(apu == 4){ eka = "e" + eka + "e"; } if(apu == 5){ eka = "f" + eka + "f"; } if(apu == 6){ eka = "g" + eka + "g"; } if(apu == 7){ eka = "h" + eka + "h"; } apu2++; } System.out.println(eka); } }