Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = in.nextInt(), m = in.nextInt();
- String inp [] = new String[m];
- int total = n, distress = 0;
- for (int i = 0; i < m; i++) {
- String s = in.nextString();
- String [] ins = s.split(" ");
- out.println(ins[0]);
- // if(inp[i].charAt(0) == '+') total += Integer.parseInt(ins[1]);
- // else{
- // int get = Integer.parseInt(ins[1]);
- // if(get<total) total-= get;
- // else distress++;
- // }
- }
- out.print(total +" "+distress);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement