Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6. int main() {
  7. ifstream df("U1.txt");
  8. ofstream rf("U1rez.txt");
  9.  
  10. int n,a[10000], i,d=0;
  11.  
  12. df>>n;
  13.  
  14. for(i=1;i<=n;i++)
  15. {
  16. df>>a[i];
  17. }
  18. for(i=1;i<=n-2;i++)
  19. {
  20. if(a[i]+1==a[i+1] && a[i]+2==a[i+2])
  21. {
  22. d=1;
  23. }
  24. }
  25. if(d==1)
  26. {
  27. rf<<"TAIP";
  28. }
  29. else
  30. {
  31. rf<<"NE";
  32. }
  33. df.close();
  34. rf.close();
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement