#include<stdio.h> int main(){ int n,i,max,min,temp1,temp2; int a[100]; scanf("%d",&n); a[max]=a[min]=0; for(i=0;i<n;i++){ if(a[max]<a[i]){ max=i; } if(a[min]>a[i]){ min=i; } } temp1=max;max=a[0];a[0]=temp1; temp2=min;min=a[n-1];a[n-1]=temp2; printf("%d"a[i]); return 0; } /* Main.c: In function 'main': Main.c:17:14: error: expected ')' before 'a' printf("%d"a[i]); ^ Main.c:17:14: warning: format '%d' expects a matching 'int' argument [-Wformat=] */ |
Double click to view unformatted code.