#include <stdio.h> int main() { char a[100]; char b[100]; char c[100]; char d[100]; gets(a); gets(b); gets(c); gets(d); if(strcmp(a,b)>0) { strcpy(t,a); strcpy(a,b); strcpy(b,t); } if(strcmp(a,c)>0) { strcpy(t,a); strcpy(a,c); strcpy(c,t); } if(strcmp(b,c)>0) { strcpy(t,b); strcpy(b,c); strcpy(c,t); } puts(a); puts(b); puts(c); } /* Main.c: In function 'main': Main.c:8:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(a); ^ Main.c:9:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(b); ^ Main.c:10:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(c); ^ Main.c:11:4: warning: 'gets' is deprecated (declared at /usr/include/stdio.h:638) [-Wdeprecated-declarations] gets(d); ^ Main.c:12:4: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration] if(strcmp(a,b)>0) ^ Main.c:14:10: warning: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration] strcpy(t,a); ^ Main.c:14:10: warning: incompatible implicit declaration of built-in function 'strcpy' Main.c:14:17: error: 't' undeclared (first use in this function) strcpy(t,a); ^ Main.c:14:17: note: each undeclared identifier is reported only once for each function it appears in Main.c:20:10: warning: incompatible implicit declaration of built-in function 'strcpy' strcpy(t,a); ^ Main.c:26:10: warning: incompatible implicit declaration of built-in function 'strcpy' strcpy(t,b); ^ */ |
Double click to view unformatted code.