Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int v[15];
  8. int n;
  9. bool f=0;
  10. cin>>n;
  11. for (int i=1; i<=n; i++)
  12. {
  13. cin>>v[i];
  14. }
  15. for(int i=1; i<=n; i++)
  16. {
  17. int a=1,b=1,c;
  18. for(int x=0;x<999999;x++)
  19. {
  20. c=a+b;
  21. if(v[i]==c)
  22. {
  23. cout<<"DA \n";
  24. f=1;
  25. break;
  26. }
  27. else if(v[i]==1)
  28. {
  29. cout<<"DA \n";
  30. f=1;
  31. break;
  32. }
  33. a=b;
  34. b=c;
  35.  
  36. }
  37. if(f==0)
  38. {
  39. cout<<"NU \n";
  40. }
  41. }
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement