Write a program, you can always receive keyboard character, if the character is lowercase uppercase characters corresponding to the output, if the reception is uppercase, lowercase characters corresponding to the output, if it is not a digital output.

Write a program, you can always receive keyboard character, if the character is lowercase uppercase characters corresponding to the output, if the reception is uppercase, lowercase characters corresponding to the output, if it is not a digital output.

#include <stdio.h>
#include <stdlib.h>
int main() {
	int ch;
	while ((ch = getchar()) != EOF) {
		if (ch >= 62 && ch <= 90) {
			ch = ch + 32;
			putchar(ch);
		}
		else if (ch >= 97 && ch <= 122) {
			ch = ch - 32;
			putchar(ch);
		}
		else {
			continue;
		}
	}
}

Guess you like

Origin blog.csdn.net/Amoralmmm/article/details/93459713