CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <string>
using namespace std;
/*Hi I have this code to code coach called symbols that prints out error.The task is to Take a text that includes some random symbols and translate it into a text that has none of them. The resulting text should only include letters and numbers.
*/
int main() {
string x;
int y = 0;
cin>>x;
while(y!=x.length()){
int z=0;
if(x[z]>='a'&&x[z]<='z')
/*the problem is that code says ISO forbids comparison between pointer and integer. Which is weird because there are no pointers or integers here. This if just checks if the x[0] is between a and z. Why doesn'tthat work?*/
{
cout<<x;
z++;
}
else
{
break;
}
cin>>x;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run