void main(){ char a,s,c;char max,min;printf("Please input three numbers:");scanf("%c,%c,%c",&a,&b,&c);max=a;if(max<b) max=b;if(max<c) max=c;printf("max=%c\n",max);min=a;if(min>b) min=b;if(min>c) min=c;printf("min=%d\n",min);} ...
include<stdio.h> void main(){char a,b,c,t;int p,q,s;scanf("%c%c%c",&a,&b,&c);p=a;q=b;s=c;if(p>q){t=a;a=b;b=t;} if(p>s){t=a;a=c;c=t;}if(q>s){t=b;b=c;c=t;}printf("%c%c%c\n",a,b,c);} ...
b,c,tmp; while(scanf(
printf("%c%c%c\n",c4,c7,c6);return0;}
错误1:类型声明错误,不要声明成int型,要声明成char型 错误2:在每次输入之后用getchar消除回车带来的影响:include<stdio.h>int main(){char e, f, g, i = 0, b, c, d;///charwhile (scanf("%c%c%c", &e, &f, &g) != EOF){getchar();//消除回车if (e>f) {if (f>g...
scanf("%c%c%c%c",&a,&b,&c,&d)!=EOF 你输入的是4个字符啊,输出却只有3个字符
直接输入3个字符,然后比较排序就可以了,LZ是不会呢还是懒得去想,就是为了交作业?还是杭电的,C语言哪个老师教的,吴鹏,还是楼永坚还是夏一行啊?
ASCII码从小到大的顺序输出这三个字符的源代码如下:include< stdio.h> void main(){ char a,s,c;char max,min;printf("Please input three numbers:");scanf("%c,%c,%c",&a,&b,&c);max=a;if(max<b) max=b;if(max<c) max=c;printf("max=%c\n",max);min=a;if(min>b) ...