Submission details
Task:Stones
Sender:Name
Submission time:2016-09-06 17:21:16 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/Stones.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error

Code

public class Solution {
    public static void main(String[] args) {
        IO io = new IO();
        String s = io.next();
        char c = '?';
        int r = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == c) {
                r++;
            }
            c = s.charAt(i);
        }
        System.out.println(r);
    }
}