uibk_703807-Advanced-CXX/exercises/task05/strange.cpp
2020-10-22 12:46:31 +02:00

24 lines
378 B
C++

#include <iostream>
int array[5] = {};
bool contains(int v)
{
for (int i = 0; i <= 5; ++i) {
if (array[i] == v) {
return true;
}
}
return false;
}
int main()
{
for (int i = 0; i < 10; ++i) {
auto contains_text = contains(i) ? "contains " : "does not contain ";
std::cout << "array " << contains_text << i << std::endl;
}
std::cout << "done" << std::endl;
}