[Plain] Description
Translate a string of text into a password. The password rules are as follows:
The original lowercase letters are all translated into uppercase letters, and all uppercase letters are translated into lowercase letters. The following describes how to translate numbers:
0 --> 9
1 --> 8
2 --> 7
3 --> 6
4 --> 5
5 --> 4
6 --> 3
7 --> 2
8 --> 1
9 --> 0
Then, the order of all characters is reversed.
Input
Enter a string of text. The maximum number of characters cannot exceed 100.
Output
Output the encoded result.
Sample Input
China
Sample Output
ANIHC
Description
Translate a string of text into a password. The password rules are as follows:
The original lowercase letters are all translated into uppercase letters, and all uppercase letters are translated into lowercase letters. The following describes how to translate numbers:
0 --> 9
1 --> 8
2 --> 7
3 --> 6
4 --> 5
5 --> 4
6 --> 3
7 --> 2
8 --> 1
9 --> 0
Then, the order of all characters is reversed.
Input
Enter a string of text. The maximum number of characters cannot exceed 100.
Output
Output the encoded result.
Sample Input
China
Sample Output
ANIHC
[Plain] # include <stdio. h>
# Include <string. h>
Int main ()
{
Int I;
Int length;
Char string [101];
Gets (string );
Length = strlen (string );
For (I = 0; I <length; I ++)
{
If (string [I] <= 'Z' & string [I]> = 'A ')
{
String [I] = string [I]-32;
}
Else if (string [I] <= 'Z' & string [I]> = 'A ')
{
String [I] = string [I] + 32;
}
Else if (string [I] <= '9' & string [I]> = '0 ')
{
String [I] = '9'-string [I] + '0 ';
}
}
For (I = length-1; I> = 0; I --)
{
Printf ("% c", string [I]);
}
Return 0;
}
# Include <stdio. h>
# Include <string. h>
Int main ()
{
Int I;
Int length;
Char string [101];
Gets (string );
Length = strlen (string );
For (I = 0; I <length; I ++)
{
If (string [I] <= 'Z' & string [I]> = 'A ')
{
String [I] = string [I]-32;
}
Else if (string [I] <= 'Z' & string [I]> = 'A ')
{
String [I] = string [I] + 32;
}
Else if (string [I] <= '9' & string [I]> = '0 ')
{
String [I] = '9'-string [I] + '0 ';
}
}
For (I = length-1; I> = 0; I --)
{
Printf ("% c", string [I]);
}
Return 0;
}