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