Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5. int unos, temp1, b, temp2,rjes;
  6. int main()
  7. {
  8. cin>>unos;
  9. temp1=unos/10;
  10. while(temp1>=1)
  11. {
  12. temp1=temp1/10;
  13. b++;
  14. }
  15. while(b>=0)
  16. {
  17. temp2=unos/pow(10,b);
  18. rjes+=temp2%10;
  19. b=b-3;
  20. }
  21. cout<<rjes;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement