import java.util.Scanner; class Another { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int money = 0; int testCases = scanner.nextInt(); scanner.nextLine(); while (testCases-- > 0) { String operation = scanner.nextLine(); if (operation.equals("report")) { System.out.println(money); } else { String arr[] = operation.split(" "); money += Integer.parseInt(arr[1]); } } } }
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন