+ 9
E.g. #include <iostream> #include <ctime> #include <cstdlib> /* Code by Hatsy Rei. Redistributable for non-commercial usage unless stated otherwise. */ int main() { srand(time(NULL)); int num = -1; int crime = 20; while (num != 0) { std::cout << "Please input zero : "; std::cin >> num; if (std::cin.fail() || num != 0) { std::cin.clear(); std::cin.ignore(512, '\n'); crime += 1 + rand() % 20; std::cout << "WARNING. Your crime coefficient has risen due to failure to follow instructions." << std::endl; std::cout << "Crime coefficient : " << crime << std::endl; } if (crime >= 300) { std::cout << "Dominator is now in Lethal Eliminator mode." << std::endl; } else if (crime >= 100) { std::cout << "Dominator is now in Non-Lethal Paralyzer mode." << std::endl; } } return 0; }
19th Apr 2017, 2:27 PM
Hatsy Rei
Hatsy Rei - avatar