CSES - Datatähti 2017 alku - Results
Submission details
Task:Pakkaus
Sender:tuomask
Submission time:2016-10-05 19:21:23 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/Pakkaus.java:24: error: illegal start of expression
					c.equals("9") || ) {
					                 ^
1 error

Code

import java.util.*;
import java.util.regex.Pattern;

public class Pakkaus {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		
		int kerroin = 0;
		String kerrattava = "";
		
		for (int i=0; i<input.length(); i++) {
			String c = input.substring(i, i+1);
			
			if (c.equals("0") || 
					c.equals("1") || 
					c.equals("2") || 
					c.equals("3") || 
					c.equals("4") || 
					c.equals("5") || 
					c.equals("6") || 
					c.equals("7") || 
					c.equals("8") || 
					c.equals("9") || ) {
					
				if (!kerrattava.isEmpty()) {
					while (kerroin > 0) {
						System.out.print(kerrattava);
						kerroin--;
					}
					kerrattava = "";
					kerroin = Integer.valueOf(c);
				} else {
					kerroin = kerroin*10 + Integer.valueOf(c);
				}
			} else {
				kerrattava = kerrattava + c;
			}
		}
		
		while (kerroin > 0) {
			System.out.print(kerrattava);
			kerroin--;
		}
	}
}