标签:ring 方便 return into 括号 cin ios seq iostream
#include <iostream> #include <string> using namespace std; int main() { string ss; int shift,l,K = 0; while(cin>>ss) { if(ss[0] == ‘-‘) break; l = 0; shift = 0; for(int i = 0;i < ss.length();i++) { if(ss[i] == ‘{‘) l++; else if(l) l--; else { l++; shift++; } } cout<<++K<<". "<<l/2+shift<<endl; } return 0; }
标签:ring 方便 return into 括号 cin ios seq iostream
原文地址:http://www.cnblogs.com/immortal-worm/p/6079809.html