Based on the number of input data, scanf will return the number of successfully allocated data. According to this return value, it can be judged whether all the data to be input have been input:
n=scanf("%d %d %d %d %d %d ",
& Ampistono [i], & Computer [i], & Mathematics [i], & English [i], & Chinese [i], & Physics [i]);
If (n==6) {// input is correct}
Else {// error handling}