|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char s[101];
- int i;
- while(gets(s)) {
- for(i=strlen(s)-1;i>=0;i--)
- if(s[i]>='0'&&s[i]<='9')
- putchar('9'-s[i]+'0');
- else if(s[i]>='a'&&s[i]<='z')
- putchar(s[i]-32);else if(s[i]>='A'&&s[i]<='Z')
- putchar(s[i]+32);else
- putchar(s[i]);
- printf("\n");
- }
- return 0;
- }
复制代码
这个是网上百度的(在上面)
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int a,b,d[100],e,f,max,sum,g,h;
- char c[100];
-
- while(scanf("%s",c)!=EOF)
- {
-
-
- for(g=0;c[g]!='\0';g++)
- {
- if(c[g]>='a'&&c[g]<='z')
- {
- c[g]=c[g]-32;
- }
- else if(c[g]>='A'&&c[g]<='Z')
- {
- c[g]=c[g]+32;
- }
-
-
-
-
- }
- h=strlen(c)-1;
- for(;h>=0;h--)
- {
- printf("%c",c[h]);
- }
- printf("\n");
-
- }
-
- return 0;
-
- }
复制代码
这是我自己写的,鱼C快帮帮忙,我写了一下午了,功能明明都差不多,为什么我这个题目不能通过检测?
这是个把大写换成小写,然后数字变换的程序,希望大家能帮我分析出两者有区别? |
|