题目链接:https://www.nowcoder.com/acm/contest/115/A

       水题


AC代码:

#include <iostream>
#include <cstring>
using namespace std;
int main()
{
  int n;
  cin>>n;
  while(n--){
    int a;
    cin>>a;
    if(a == 0){
      int x,y;
      cin>>x>>y;
      cout<<x+y<<endl;
    }
    else{
      string str;
      cin>>str;
      cout<<str.length()<<endl;
    }
  }
  return 0;
}