daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int pirmais,otrais,cikdien;
  8.     cin>>pirmais>>otrais>>cikdien;
  9.     int m[cikdien];
  10.     m[0] = pirmais;
  11.     m[1] = otrais;
  12.  
  13.     for(int i = 2; i < cikdien;i++)
  14.     {
  15.         m[i] = (m[i-1] + m[i-2])% 10;
  16.     }
  17.     cout<<m[cikdien - 1];
  18.     return 0;
  19. }
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