" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <string>
using namespace std;
int main()
{
string tekst;
int klucz = 0;
cout << "Podaj tekst:";
getline(cin,tekst);
cout << "Podaj klucz:";
cin >> klucz;
for(int x = 0; x < tekst.length(); x++)
{
for (int y = 65; y <=122; y++)
{
if (tekst[x] == (char)y)
cout << (char)(y+klucz);
}
if (tekst[x] == ' ')
cout << " ";
}
return 0;
}