fork(26) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int table[4];
  6. bool exists_in_table(int v)
  7. {
  8. for (int i = 0; i <= 4; i++) {
  9. if (table[i] == v) return true;
  10. }
  11. return false;
  12. }
  13.  
  14.  
  15. int main() {
  16. if (exists_in_table(0))
  17. cout<<"0.\n";
  18. if (exists_in_table(1))
  19. cout<<"1.\n";
  20. if (exists_in_table(2))
  21. cout<<"2.\n";
  22. if (exists_in_table(3))
  23. cout<<"3.\n";
  24. if (exists_in_table(4))
  25. cout<<"4.\n";
  26. if (exists_in_table(42))
  27. cout<<"42.\n";
  28. // your code goes here
  29. return 0;
  30. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
0.
1.
2.
3.
4.
42.