題目鏈接在此。
#include<stdio.h>int main(){ int n; int temp; double a1=0,a2=0,a3=0,a4=0,a5=0; int zero[10000],one[10000],two[10000],three[10000],four[10000]; int z=0,o=0,tw=0,th=0,f=0; scanf("%d",&n); for(int i = 0 ; i < n; i++){ scanf("%d",&temp); if(temp % 5 == 0){ zero[z++] = temp; }else if(temp % 5 == 1){ one[o++] = temp; }else if(temp % 5 == 2){ two[tw++] = temp; }else if(temp % 5 == 3){ three[th++] = temp; }else if(temp % 5 == 4){ four[f++] = temp; } } //求A1 int A1 = 0; for(int i = 0 ; i < z; i++){ if(zero[i]%2 == 0){ A1 += zero[i]; } } if(A1 == 0){新聞熱點
疑難解答