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/e0ace1a88a9564945c568b45e99f4190 to your computer and use it in GitHub Desktop.
Save horvathgyozo/e0ace1a88a9564945c568b45e99f4190 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
//1. dekl
int n;
string nap;
const string napok[7+1] = {
"","H","K","Sze","Cs","P","Szo","V"
};
//2. beolv
bool jo;
do {
cout << "Het hanyadik napja: ";
cin >> n;
jo = n>=1 && n<=7;
if (!jo) {
cout << "Nem jo" << endl;
}
} while(!jo);
//3. feld, alg
nap = napok[n];
//4. ki
cout << "Ez az a nap: " << nap << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment