Skip to content

Instantly share code, notes, and snippets.

@horvathgyozo
Created October 18, 2016 09:48
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/e518f3f95f2a2ac22e41f9a00588b2ad to your computer and use it in GitHub Desktop.
Save horvathgyozo/e518f3f95f2a2ac22e41f9a00588b2ad to your computer and use it in GitHub Desktop.
#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