Click Here to go back to the homepage.

Help a PhD candidate out! Solution:


import java.util.*;

public class Kattis {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int cases = Integer.parseInt(sc.nextLine());
        for(int i = 0; i < cases; i++){
            String s = sc.nextLine();
            if(s.equals("P=NP"))
                System.out.println("skipped");
            else
                System.out.println(Integer.parseInt(s.split("\\+")[0]) + Integer.parseInt(s.split("\\+")[1]));
        }
    }
}