• [1495] Single Calculate System

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Give you some numbers, you should tell the sum. But there is a lock, when it locked, anything you input is invaild until unkock. If you lock it, whatever the status it is, it is locked. If you unlock it, whatever how it is, it will unlock.
  • 输入
  • There are many test cases. Each test case contains a integer N(1<=N<=100), means there are N lines follow, each line is a operation. If it is a number x, 2<=X<=100
  • 输出
  • For each test case, output the sum of this test case.
  • 样例输入
  • 5
    5
    LOCK
    6
    UNLOCK
    7
    5
    LOCK
    1
    2
    3
    UNLOCK
    
  • 样例输出
  • 12
    0
    
  • 提示
  • 来源
  • Mr.Cai
  • 操作

显示春菜