Home > Back-end >  For help! Help to see where there is a problem C
For help! Help to see where there is a problem C

Time:09-26

# include "iostream"
using namespace std;
Int main () {
Char a;
int i;
For (I=0;; I++)
{
A=getchar ();
If (a & gt;='A' & amp; & A. & lt;='Z')
Putchar (2 * 'M' - a + 1);
Else if (a & gt;='a' & amp; & A. & lt;='z')
Putchar (2 * 'm' - a + 1);
Else if (a==')
break;
}
}

To enter A output Z, input b output y, other letters corresponding rule is as follows:
A - & gt; A - Z & gt; Z
B-> Y b - & gt; Y
.
Z - & gt; A to z - & gt; A
And input to the decimal point. End of the cycle,



Turn a great god, and there are no errors, but the output is not correct

CodePudding user response:

# include & lt; iostream>

using namespace std;

Int main ()
{
String a;
Cin> a;
for(i=0; i {
If (a [I]!='& amp; & A [I] & gt;='a' & amp; & A [I] Else if (a [I]!='& amp; & A [I] & gt;='A' & amp; & A [I] The else return 0;
}
}

CodePudding user response:

Putchar to
Putchar (" Z "- a + 'a')
Putchar (" z "- a + 'a')
To figure out the calculating formula of flashbacks
  • Related