Created
October 18, 2016 09:48
-
-
Save horvathgyozo/e518f3f95f2a2ac22e41f9a00588b2ad 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, beki | |
int n; //be | |
string sz[100+1]; //be | |
bool ferfi; | |
//2. be | |
bool jo; | |
do { | |
cout << "N="; | |
cin >> n; | |
jo = n>=0 && n<=100; | |
if (!jo) { | |
cout << "Nem jo" << endl; | |
} | |
} while(!jo); | |
for (int i = 1; i<=n; i++) { | |
do { | |
cout << i << ". szsz: "; | |
cin >> sz[i]; | |
jo = sz[i].length() == 11 && | |
(sz[i][0] == '1' || | |
sz[i][0] == '2'); | |
if (!jo) { | |
cout << "Nem jo" << endl; | |
} | |
} while(!jo); | |
} | |
//3. feld, alg | |
int i = 1; | |
while (i<=n && sz[i][0]!='1') { | |
i = i + 1; | |
} | |
ferfi = i<=n; | |
//4. ki | |
if (ferfi) { | |
cout << "Van ffi" << endl; | |
} else { | |
cout << "Nincs ffi" << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment