-
c To convert lowercase letters to uppercase letters, ** is as follows:
#include
using namespace std;
void main(void)
char i;
cout<<"Enter lowercase letters'#'END:">i;
if((i>=97)&&i<=122))
i=i-32;
cout break;
The current program can input multiple lowercase letters at the same time, and can convert multiple lowercase letters into uppercase letters at the same time, the principle of this program is to input lowercase letters, subtract 32 from the ascii code of lowercase letters to convert them into uppercase letters, and when all lowercase letters are converted, it will jump out of the loop to end the program.
-
First of all, I want to say that the letter should be of type char or string, otherwise how can it contain letters?
It's very simple toupper(letter) is to replace all the letters of the letter variable with uppercase, and tolower(letter) is to make it lowercase, ok.
-
#include
using namespace std;
const int n=5;
void main()
char a[n];
cin>>a;
char b[n];
for(int i=0;ib[i]=char(int(a[i])-32);
for( i=0;icout "But this program can only enter 5 characters.
You can make some changes as needed.
For example, change n=5 to the number of characters you want.
Or to make a partial change is that it can enter arbitrary characters.
-
In ASCII code, the uppercase letters are 32 smaller than the lowercase letters
-
What type of letter is it?
If it's char
#include
Use stupr (letter).
If it is string, you can convert it to char first
char str[1024];
strcpy(str,letter = strupr(str);
-
Informatics Olympiad 1138 - Converting lowercase letters in strings to uppercase letters.
-
It is to convert uppercase letters into lowercase letters, and the difference between ASCII code values between uppercase and lowercase letters is 32, as long as it is determined that the uppercase letters increase by 32, it is a lowercase letter.
-
Assuming that the uppercase variable to be converted is c and the variable where the result is stored is s, the ** of the conversion process is: s=c+'a'-'a'。
-
If you convert the case of the letters, you can use the ASCII code The uppercase ascll of the letters is 32 smaller than the ascll code of the lowercase letters, and the number 32 can be directly subtracted.
It's textbox, right? textbook?
double somedouble; >>>More
int a =;
int b =; >>>More
You save the path in an XML and read it out the next time you start it.
You can pass the main window as a parameter to a child window. >>>More
I've been thinking about similar questions, and I'd like to share my opinion: >>>More