Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- unsigned long long it(int n)
- {
- unsigned long long a = 0, b = 1;
- for(int i=0;i<n;i++)
- {
- b += a;
- a = b-a;
- }
- return a%1000000007;
- }
- int main(){
- int n, ile;
- cin>>ile;
- int * tab = new int[ile];
- for(int i=0;i<ile;i++)
- {
- cin>>n;
- tab[i]=n;
- }
- for(int j=0;j<ile;j++)
- {
- cout<<it(tab[j])<<endl;
- }
- delete [] tab;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement