Advertisement
Guest User

Fibo_SumaCifre_eu

a guest
Sep 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define mod 9
  3.  
  4. using namespace std;
  5. unsigned long long N;
  6. int per[]={0, 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 0, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1};
  7. int main()
  8. {
  9.  
  10.     cin>>N;
  11.     if(N==0)
  12.     {
  13.         cout<<N;
  14.         return 0;
  15.     }
  16.     if(per[N%24])
  17.         cout<<per[N%24];
  18.     else
  19.         cout<<9;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement