#include<stdio.h> int main() { int a[10],i,j,n; scanf("%d",a[i]); for(i=0;i<10;i++) for(j=0;j<10;j++) { if(a[i]>a[j]) n=a[i]; a[j]=n; a[i]=a[j]; } printf("%d",a[i]) } /* Main.c: In function 'main': Main.c:5:3: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=] scanf("%d",a[i]); ^ Main.c:15:1: error: expected ';' before '}' token } ^ */ |
Double click to view unformatted code.