scanf_s("%d",&a[i]);
第6-8行的for循环不对,你每次输入的都是a数组的第10位(scanf_s("%d",a[10]);),应将第6-8行改成
for(int i=0; i<10; i++) { scanf("%d",a[i]); }
保证a数组的每一位都输入了。