c语言编程 1到10选出其中的偶数相加,并写出结果

日期:2021-08-20 13:04:45 人气:1

c语言编程 1到10选出其中的偶数相加,并写出结果

#include <stdio.h> void main () { int i,a[i],s=0; printf("请输入1到10十个整数:"); for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=0;i<10;i++)if(a[i]%2==0) s=s+a[i];printf("其中偶数的和为:") printf("%d",s);}
    A+
热门评论