请问我的代码哪错了?
#include <stdio.h>
#include <string.h>
int main() {
char a[100],b[100],c[100],max1[100],max2[100];
gets(a);
gets(b);
gets(c);
if(strcmp(a,b)>=0)
{
strcpy(max1,a);
}
else strcpy(max1,b);
if(strcmp(b,c)>=0)
{
strcpy(max2,b);
}
else strcpy(max2,b);
if(strcmp(max1,max2)>=0)
printf("%S",max1);
else printf("%s",max2);
}
你第17行应该把C复制到max2
大小写
if(strcmp(b,c)>=0)
{
strcpy(max2,b);
}
else strcpy(max2,b);
不细心啊
你这不管b大还是c大,都把b给max2啊
还有printf("%S",max1);,这里你S大写了