#include <stdio.h> int main(){ int num[10]; int i,temp; for(i=0; i<10; i++) scanf("%d",&num[i]); scanf("%d",&temp); if(num[8]<=temp) num[9]=temp; else{ for(i=8; i>=0; i--){ if(num[i]>temp) num[i+1]=num[i]; temp[i+1]=temp; } } for(i=0; i<10; i++) printf("%d\n",num[i]); return 0; } /* Main.c: In function 'main': Main.c:14:8: error: subscripted value is neither array nor pointer nor vector temp[i+1]=temp; ^ */ |
Double click to view unformatted code.