Advertisement
ngbmameman

Untitled

Aug 22nd, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool Test(int z);
  5. char Show(int t);
  6. char k[26];
  7.  
  8. int main(){
  9.  
  10.  
  11.     int age;
  12.  
  13.    
  14.     cout << Show(0) << endl;    
  15.     cout << "Guess persons age: ";
  16.     cin >> age;
  17.    
  18.     int holder = Test(age);
  19.  
  20.  
  21.     if (holder == true){
  22.         cout << "\nyou guessed right" << endl;
  23.     }
  24.     else{
  25.         cout << "\nwrong";
  26.     }
  27.    
  28.    
  29.  return 0;
  30. }
  31.  
  32. char Show(int t){
  33.    
  34.     int ageList[10];
  35.    
  36.  
  37.     int n = 5;
  38.  
  39.    
  40.     for(int i = 0; i < 10; i++){
  41.         ageList[i] = n;
  42.         n+=5;
  43.     }
  44.     for(int i = 0 ; i < 10; i++){
  45.         k[26] = ageList[i];
  46.  
  47.     }
  48.     return k[26];
  49. }
  50. bool Test(int z){
  51.     int realAge = 20;
  52.    
  53.    
  54.    
  55.     if(z == realAge){
  56.         return true;
  57.     }
  58.     else{
  59.         return false;
  60.     }
  61.  
  62.     return false;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement