P122第28题

来源:互联网 发布:charge是什么软件 编辑:程序博客网 时间:2024/05/16 04:45
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
int i,n;
char s[100];
while(1)
{
printf("请输入一串字符\n");
gets(s);
n=strlen(s);
for(i=0;i<n;i++)
{
if(s[i]>='a'&&s[i]<='z')
  s[i]=toupper(s[i]);


 else
  s[i]=s[i];
}
printf("大小写转化后\n");
for(i=0;i<n;i++)
printf("%c",s[i]);
}
return 0;

}


0 0
原创粉丝点击