题解 | #数字求和#
数字求和
https://www.nowcoder.com/practice/e8cee01f2d834fa9ba3479fafe492b65
#include<cstdio> int main(){ int a, s[5]; while (scanf("%d %d %d %d %d %d", &a, &s[0], &s[1], &s[2], &s[3], &s[4]) != EOF){ int sum=0; for (int i = 0; i < 5; i++){ if (s[i] < a){ sum = sum + s[i]; } } printf("%d\n", sum); } }