Created
October 14, 2016 14:10
-
-
Save horvathgyozo/284c68275882c4eec86dcfe6f957d191 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 | |
int n; | |
const int MAXN = 100; | |
int evek[MAXN+1]; | |
int aktev; | |
bool vanekk; | |
//2. be | |
bool jo; | |
cout << "Akt.ev: "; | |
cin >> aktev; | |
do { | |
cout << "Hany fo (0 es " << MAXN << " kozott): "; | |
cin >> n; | |
jo = n>=0 && n<=MAXN; | |
if (!jo) { | |
cout << "Nem jo" << endl; | |
} | |
} while (!jo); | |
for (int i=1; i<=n; i++) { | |
do { | |
cout << i << ". szulev: "; | |
cin >> evek[i]; | |
jo = evek[i]<=aktev && evek[i]>1900; | |
if (!jo) { | |
cout << "Nem jo" << endl; | |
} | |
} while(!jo); | |
} | |
//3. feld, alg | |
int i = 1; | |
while (i<=n && !(aktev - evek[i]<=18)) { | |
i = i + 1; | |
} | |
vanekk = i<=n; | |
//4. ki | |
// cout << (vanekk ? "Van" : "Nincs") << " kk" << endl; | |
if (vanekk) { | |
cout << "Van kk" << endl; | |
} else { | |
cout << "Nincs kk" << endl; | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment