Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: guess.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main(){
- const int age=26;
- int x, count=0;
- do{
- cout << "Guess my age: "; cin >> x;
- count++;
- if( x > age ) cout << "Too high! ";
- if( x < age ) cout << "Too low! ";
- } while(x != age );
- cout << endl << "Well done - that took you " << count << " tries." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement