题解 | #数字求和#
数字求和
https://www.nowcoder.com/practice/e8cee01f2d834fa9ba3479fafe492b65
#include<cstdio> int main(){ int a,b,c,d,e,f; while(scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f) != EOF){ int sum = 0; if(b<a){ sum += b; } if(c<a){ sum += c; } if(d<a){ sum += d; } if(e<a){ sum += e; } if(f<a){ sum += f; } printf("%d\n",sum); } }