Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. int n,c=0;
  2. scanf("%d",&n);
  3. do{
  4. n=n/10;
  5. c++;
  6. }while(n!=0);
  7. printf("%d",c);
  8.  
  9. int main() {
  10. int n;
  11. int begin, end;
  12. scanf(" %n%d%n", &begin, &n, &end);
  13. printf("%0*d",end-begin, n);
  14. return 0;
  15. }
  16.  
  17. 0000
  18. 0000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement