daily pastebin goal
9%
SHARE
TWEET

P2

a guest Mar 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int primacifra ( int n)
  4. {
  5.     if(n<=9)
  6.         return n;
  7.     else
  8.         return primacifra(n/10);
  9. }
  10. int main()
  11. {
  12.     int n;
  13.     cin>>n;
  14.     cout<< primacifra(n);
  15.     return 0;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top