Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int v[15];
- int n;
- bool f=0;
- cin>>n;
- for (int i=1; i<=n; i++)
- {
- cin>>v[i];
- }
- for(int i=1; i<=n; i++)
- {
- int a=1,b=1,c;
- for(int x=0;x<999999;x++)
- {
- c=a+b;
- if(v[i]==c)
- {
- cout<<"DA \n";
- f=1;
- break;
- }
- else if(v[i]==1)
- {
- cout<<"DA \n";
- f=1;
- break;
- }
- a=b;
- b=c;
- }
- if(f==0)
- {
- cout<<"NU \n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement