All pastes #474475 Raw Edit

Someone

public cpp v1 · immutable
·published 2007-05-06 21:04 UTC
rendered paste body
#include <cstdlib>#include <iostream>using namespace std;const int MAX=4;void numberthanten(int number){    if(number>10){          cout << "The number you entered is bigger than 10 !" << endl;    }else if(number==10){          cout << "The number you entered is exactly 10 !" << endl;    }else{          cout << "The number you entered is smaller than 10.." << endl;    }}void twicethanten(int twice){    if(twice>10){          cout << "is bigger than 10 !]" << endl;    }else if(twice==10){          cout << "equals 10 !]" << endl;    }else{          cout << "is also smaller than 10 !]" << endl;    }}void check(char* input, int i){          if(!isdigit(input[i]))          {                  cout << "Wrong input: \"" << input[i] << "\" please correct: ";                  cin.clear();                  cin.ignore(99,'\n');                  cin.get(input[i]);      	          return;          }}int main(int argc, char *argv[]){    char input[MAX];    int transfer[4];    int twice;        cout << "Please enter a number [3 digits]: ";    cin.get(input, MAX);        for(int i=0; i<4; i++)    {                 while(!isdigit(input[i]))                 {                     check(input, i);                     i = 0;                 }                 if(isdigit(input[0]) && isdigit(input[1]) && isdigit(input[2]))                 {                 break;                 }    }     cout << input;    numberthanten(char input);    twice = transfer * 2;    twicethanten(twice);         system("pause");    return EXIT_SUCCESS;}