CSES - Datatähti 2017 alku - Results
Submission details
Task:Pakkaus
Sender:sp
Submission time:2016-10-04 22:47:23 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/Compresio12n.java:24: error: cannot find symbol
       int h=d[0].length();
             ^
  symbol:   variable d
  location: class Compresio12n
input/Compresio12n.java:27: error: cannot find symbol
        int x = Integer.parseInt(d[0]);
                                 ^
  symbol:   variable d
  location: class Compresio12n
input/Compresio12n.java:30: error: cannot find symbol
            answer = answer+d[i+1];
                            ^
  symbol:   variable d
  location: class Compresio12n
input/Compresio12n.java:30: error: cannot find symbol
            answer = answer+d[i+1];
                              ^
  symbol:   variable i
  location: class Compresio12n
input/Compresio12n.java:38: error: cannot find symbol
       int h1=d[0+1].length();
              ^
  symbol:   variable d
  location: class Compresio12n
5 errors

Code

import java.util.Scanner;
/**
*
* @author Miro Petsalo
*/
public class Compresio12n {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String c = s.nextLine();
int nb2 =c.length();
String answer ="";
while (nb2>0) {
int h=d[0].length();
int x = Integer.parseInt(d[0]);
c=c.substring(h);
while(x>0){
answer = answer+d[i+1];
x=x-1;
}
int h1=d[0+1].length();
c=c.substring(h1);
nb2 =c.length();
}
System.out.println(answer);
}
}