CSES - Datatähti 2022 alku - Results
Submission details
Task:Merkkijono
Sender:user2874
Submission time:2021-10-12 09:11:17 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/Main.java:7: error: cannot find symbol
                String eka = a;
                             ^
  symbol:   variable a
  location: class Main
1 error

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());
		int 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);
	}
}