fork download
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int snackDownYears[5] = {2010, 2015, 2016, 2017, 2019};
  7.  
  8. bool wasSnackDownHosted(int year)
  9. {
  10. for (int i = 0; i < 5; i++)
  11. {
  12. if (snackDownYears[i] == year)
  13. return true;
  14. }
  15. return false;
  16. }
  17.  
  18. int main()
  19. {
  20. int t;
  21. cin>>t;
  22. while(t--){
  23. int year;
  24. cin >> year;
  25.  
  26. if (wasSnackDownHosted(year))
  27. cout << "Hosted " << endl;
  28. else
  29. cout << "Not Hosted " << endl;
  30. }
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5516KB
stdin
2
2017
2019
stdout
Hosted 
Hosted