foo.c: In function 'main':
foo.c:10:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &arr[i]);
^~~~~~~~~~~~~~~~~~~~
foo.c:26:2: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
printf("%-4d", arr[i]);
^~~~~~~~~~~~~~~~~~~~~~
foo.c:24:2: note: within this loop
for(i=0; i<3; i++)
^~~
foo.c:16:17: warning: iteration 1 invokes undefined behavior [-Waggressive-loop-optimizations]
if(arr[j]<arr[j+1])
~~~^~~~~
foo.c:14:6: note: within this loop
for(j=0; j< 2-i; j++)
^~~
foo.c:16:17: warning: array subscript is above array bounds [-Warray-bounds]
if(arr[j]<arr[j+1])
~~~^~~~~
foo.c:20:7: warning: array subscript is above array bounds [-Warray-bounds]
arr[j+1]=t;
~~~^~~~~
[Hydro](https://hydro.ac)提供评测服务