|
Post by Cezary Kos on Oct 8, 2014 19:05:02 GMT
So programming the homework when it breaks at an if statement Code: #include <iostream>
#include <string>
using namespace std;
int main() //Caesar Cipher
{
int x = 0;
string word;
cout << "Please enter a word" << endl;
cin >> word;
cout << "Please enter an offset" << endl;
cin >> x;
for (int i = 0; i < word.length(); i++)
word = word + x;
if (word > 122)
{
word = word - 26;
}
cout << word;
return 0;
}
Thanks for the help
|
|