//_51_读写字符
//_51_main.cpp
//getchar()从键盘读入一个字符、
//putchar()向显示屏显示一个字符
/*
getchar()的原始形式中,输入先被缓冲,直到键入回车时才返回
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main()
{
char ch;
printf("Please enter some text(input a point to quit).\n");
do{
ch = getchar();
if(islower(ch))//查看ch是否为小写字符
ch = toupper(ch);
else
ch = tolower(ch);
putchar(ch);
}while(ch != '.');
system("pause");
return 0;
}
51_读写字符
最新推荐文章于 2022-09-21 16:27:28 发布