CSES - Datatähti 2022 alku - Results
Submission details
Task:Merkkijono
Sender:user2874
Submission time:2021-10-12 09:09:06 +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:9: error: incompatible types: int cannot be converted to boolean
                            if(apu = 1){
                                   ^
input/Main.java:12: error: incompatible types: int cannot be converted to boolean
                            if(apu = 2){
                                   ^
input/Main.java:15: error: incompatible types: int cannot be converted to boolean
                            if(apu = 3){
                                   ^
input/Main.java:18: error: incompatible types: int cannot be converted to boolean
                            if(apu = 4){...

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