A.cpp 447 B

123456789101112131415161718192021222324
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int Length(int n){
  4. int s=0;
  5. while(n>0){
  6. n=n/10;
  7. ++s;
  8. }
  9. return s;
  10. }
  11. int main(){
  12. int n;
  13. cin>>n;
  14. cout<<Length(n);
  15. return 0;
  16. }
  17. /**************************************************************
  18. Problem: 2263
  19. User: acm
  20. Language: C++
  21. Result: 正确
  22. Time:0 ms
  23. Memory:2016 kb
  24. ****************************************************************/