Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. int n = in.nextInt(), m = in.nextInt();
  2. String inp [] = new String[m];
  3. int total = n, distress = 0;
  4. for (int i = 0; i < m; i++) {
  5. String s = in.nextString();
  6. String [] ins = s.split(" ");
  7. out.println(ins[0]);
  8. // if(inp[i].charAt(0) == '+') total += Integer.parseInt(ins[1]);
  9. // else{
  10. // int get = Integer.parseInt(ins[1]);
  11. // if(get<total) total-= get;
  12. // else distress++;
  13. // }
  14. }
  15. out.print(total +" "+distress);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement