Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long numar(int n)
- {
- int cif;
- cout<<"cifra"; cin>>cif;
- if(cif<0 || cif>9)
- return n;
- else
- return numar(n*10+cif);
- }
- int main()
- {
- int nr;
- nr=numar(0);
- cout<<"numarul= "<<nr;
- return 0;
- }
Add Comment
Please, Sign In to add comment