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