Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int zbir_na_cifri(int a)
- {
- if(a==0)
- return 0;
- else
- return a%10 + zbir_na_cifri(a/10);
- }
- int main()
- {
- int a;
- cin>>a;
- cout<<zbir_na_cifri(a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement