Answer the question
In order to leave comments, you need to log in
variable char. It seems like I replaced the letters, but the text is not displayed. Why?
Through step-by-step debugging, you can see that the replacement is taking place, but only a dot is displayed on the screen. You need to replace 'a' with 'b' and 'b' with 'a'.
#include<iostream>
#include <cstring>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<conio.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "RUS");
char bukva;
bool proverka = false;
int i = 98,x=97;
cout << "Введите текст = " << endl;
do {
cin >> bukva;
if (bukva == 'a')
{
proverka = true;
}
if (proverka)
{
char bukva = i;
proverka = false;
}
if (bukva == 'b')
{
proverka = true;
}
if (proverka)
{
char bukva = x;
proverka = false;
}
} while (bukva != '.');
cout << "Текст после изменений = " << bukva << endl;
system("PAUSE");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question