Mam tady takovej kód ,kterej by rozhodne mel fungovat, ale nefunguje pls pomozte mi.
#include <iostream>
using namespace std;
int main()
{
system("color 2");
int a = 0;
char heslo[20];
while(true)
{
cout << "\n\n\tHeslo: ";
cin.getline(heslo,19);
a++;
if(heslo[0] == 'k' && heslo[1] == 'o' && heslo[2] == 's' && heslo[3] == 't' && heslo[4] == 'e' && heslo[5] == 'l')
{
break;
}
if(a == 3)
{
cout << "chzba";
}
cout << "\nPristup zamitnut";
}
system("cls");
cout << "\n\n\tPristup povolen!";
//**********************************************************************************************
int vyber;
cout << "\n\n\t(1) Zakodovat";
cout << "\n\t(2) Dekodovat";
cout << "\n\t(3) Konec";
cout << "\n\t\tVyber: ";
cin >> vyber;
if(vyber != 1 && vyber != 2)
{
cin.get();
cin.get();
return 0;
}
system("cls");
//**********************************************************************************************
int j = 0;
char slovo [50];
bool i = false;
char znak = 0;
if(vyber == 1)
{
cout << "\n\n\n\tVlozte slovo: ";
cin.getline(slovo,49);
cout << slovo;
while(j < 50)
{
slovo[j] = slovo[j] == 'a' ? '2' : slovo[j];
slovo[j] = slovo[j] == 'b' ? 'z' : slovo[j];
//tady jsou dalsi zmeny, ale z duvodu ochrany programu je neuvádim
j++;
}
cout << slovo;
}
//**********************************************************************************************
if(vyber == 2)
{
cout << "\n\n\n\tVlozte slovo: ";
cin.getline(slovo,49);
}
//**********************************************************************************************
cin.get();
cin.get();
return 0;
}
dojde to az k "zadejte slovo: " a pak se to celé vypne.