Skip to content

Instantly share code, notes, and snippets.

@horvathgyozo
Created October 11, 2016 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horvathgyozo/efe35b2b20d5b676207add5bdb28df26 to your computer and use it in GitHub Desktop.
Save horvathgyozo/efe35b2b20d5b676207add5bdb28df26 to your computer and use it in GitHub Desktop.
#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