Link Problem: http://uva.onlinejudge.org/external/116/11687.pdf
Problem | Verdict | Lang | Time | Best | Rank | Submit Time |
---|---|---|---|---|---|---|
| discuss11687 - | Accepted | C++11 | 0.000 | 0.000 | 700 | 15 mins ago |
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
string s;
while(cin >> s && s!="END"){
int cnt= 0;
while(s != to_string(s.size())){
s= to_string(s.size());
cnt++;
}
cout<<cnt+1<<"\n";
}
}
No comments:
Post a Comment