Translate

Views

Monday, July 25, 2022

Solution UVa: 11687 - Digits

 

Link Problem: http://uva.onlinejudge.org/external/116/11687.pdf


 Problem  VerdictLangTimeBestRankSubmit Time
 | discuss11687 - Digits AcceptedC++110.0000.00070015 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: