Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int unos, temp1, b, temp2,rjes;
- int main()
- {
- cin>>unos;
- temp1=unos/10;
- while(temp1>=1)
- {
- temp1=temp1/10;
- b++;
- }
- while(b>=0)
- {
- temp2=unos/pow(10,b);
- rjes+=temp2%10;
- b=b-3;
- }
- cout<<rjes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement