int a;
if (a == 0) || (a == 1) || (a == 3) or 15 or 27 or 36 or... (a list of random numbers)... or (a == 360) cout << "blah blah blah";
The problem is there there are perhaps 30 ORs involved... Is there anyway for me to write this more concisely instead of exhausting 30s brackets and 30s ORs?
Thanks Rollie,
Concerning the vector here... when you use the large bracket how are the elements assigned to the nums vector? Is that 1 as the first number inside the bracket assigned to nums[0] and 91 as the tenth and last number in the bracket assigned to nums[9]? Or are the numbers assigned to the elements of vectors in other ways?
#include <iostream>
int main() {
int x = 5; //this is whatever value you're comparing
int list[] = {0, 1, 3, 15, 27, 36, 55, 60, 91, 205};
for each(int a in list) {
if (x == a) {
//do whatever
}
}
}