#include<iostream>
#include<string>
#include<cctype>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
string answer;
cout << "Enter a word: ";
cin >> answer;
int length = answer.length();
for (int count = 0; count < length ; count++){
if (isalpha(answer[count])){
answer[count] = tolower(answer[count]);
//for (unsigned s = 0; s < answer.length(); s++){
answer.at(count)= 5*count+8;
cout << answer.at(count) << endl;
}
//for (int i = 0; i < 25; i++){
// if (answer[count] == 'z')
// answer[count] == 'a';
// else
// answer[count]++;
//}
}
//cout << answer;
//for (unsigned i = 0; i < answer.length();++i)
// cout << answer.at(i);
//cout << answer.at(3) << endl;
//cin >> a;
//a = toupper(a);
//cout << a;
return 0;
}
I want to know why it's showing the blocks. But also, maybe, if possible, some help, on printing out the letter in cipher code (5x+8) if I'm not doing it right?

New Topic/Question
Reply



MultiQuote




|