sicily 1491 Look and Say

简单题.....

 

 

// source code of submission 733747, Zhongshan University Online Judge System #include <iostream> #include <string> using namespace std; int main() { int n,i,num; string s; cin>>n; while(n--) { cin>>s; string::iterator iter1,iter0 = s.begin(); while(iter0!=s.end()) { num = 1; for(iter1 = iter0+1;iter1!=s.end();iter1++) { if(*iter1 == *iter0) { num++; continue; } else break; } cout<<num<<*iter0; iter0+=num; } cout<<endl; } return 0; }

你可能感兴趣的:(sicily 1491 Look and Say)