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

Compiler report

input/compresio12n.java:8: error: class Compresio12n is public, should be declared in a file named Compresio12n.java
public class Compresio12n {
       ^
1 error

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 i=0;
      
       String d[] = c.split("(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)");
       int h=d[i].length();
         
        
        int x = Integer.parseInt(d[0]);
        c=c.substring(h);
        while(x>0){
            answer = answer+d[i+1];
            x=x-1;
        }
    
     

 
       String d1[] = c.split("(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)");
       int h1=d[i+1].length();
      
         c=c.substring(h1);
        
        
       nb2 =c.length();
     
  }
      System.out.println(answer);   
    }
    
}