Created
October 11, 2016 09:44
-
-
Save horvathgyozo/efe35b2b20d5b676207add5bdb28df26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
//1. dekl | |
string lap; | |
int ert; | |
const string lapok[8+1] = { | |
"???","vii","viii","ix","x", | |
"also","felso","kiraly","asz" | |
}; | |
const int ertekek[8+1] = { | |
-99,7,8,9,10,2,3,4,11 | |
}; | |
//2. be | |
bool jo; | |
do { | |
cout << "Lap = "; | |
cin >> lap; | |
int i = 1; | |
while (i<=8 && lapok[i]!=lap) { | |
i=i+1; | |
} | |
jo=i<=8; | |
if (!jo) { | |
cout << "Nem jo" << endl; | |
} | |
} while(!jo); | |
//3. feld: alg | |
int i = 1; | |
while (lapok[i]!=lap) { | |
i=i+1; | |
} | |
ert = ertekek[i]; | |
//4. ki | |
cout << "Ertek: " << ert << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment