Advertisement
a53

codjoc

a53
Feb 9th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3. ifstream fin("codjoc.in");
  4. ofstream fout("codjoc.out");
  5.  
  6. long long int n,c,s,p=10;
  7. int main()
  8. {
  9. fin>> n;
  10. s=n;
  11. while(p<=n)
  12. {
  13. s=s+n%p;
  14. p=p*10;
  15. }
  16. fout<<s;
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement