Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool Test(int z);
- char Show(int t);
- char k[26];
- int main(){
- int age;
- cout << Show(0) << endl;
- cout << "Guess persons age: ";
- cin >> age;
- int holder = Test(age);
- if (holder == true){
- cout << "\nyou guessed right" << endl;
- }
- else{
- cout << "\nwrong";
- }
- return 0;
- }
- char Show(int t){
- int ageList[10];
- int n = 5;
- for(int i = 0; i < 10; i++){
- ageList[i] = n;
- n+=5;
- }
- for(int i = 0 ; i < 10; i++){
- k[26] = ageList[i];
- }
- return k[26];
- }
- bool Test(int z){
- int realAge = 20;
- if(z == realAge){
- return true;
- }
- else{
- return false;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement