fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. bool boolForCharIsDigi[5] = {true, true, false, false, true};
  6. bool hasPassed;
  7. int turnsDefined = 0;
  8. for(int i = 0; i < sizeof(boolForCharIsDigi)/sizeof(boolForCharIsDigi[0]); i++){
  9. if(boolForCharIsDigi[i] == false){
  10. hasPassed = false;
  11. std::cin >> turnsDefined;
  12. std::cout << "You may only use numbers to define the amount of turns. No decimals either." << std::endl << std::endl;
  13. break;
  14. }else if(boolForCharIsDigi[i] == true){
  15. hasPassed = true;
  16. }
  17. }
  18. return 0;
  19.  
  20. }
Success #stdin #stdout 0s 3300KB
stdin
5
4
3
2
1
stdout
You may only use numbers to define the amount of turns. No decimals either.