题解 | #小乐乐算平均分#
小乐乐算平均分
https://www.nowcoder.com/practice/48f89fcc444c4e00a2465b02dd8cc7e2
#include <stdio.h> int main() { float a; float sum=0.0; while (scanf("%f", &a) != EOF) { sum+=a; } printf("%.2f %.2f",sum,sum/3); }
小乐乐算平均分
https://www.nowcoder.com/practice/48f89fcc444c4e00a2465b02dd8cc7e2
#include <stdio.h> int main() { float a; float sum=0.0; while (scanf("%f", &a) != EOF) { sum+=a; } printf("%.2f %.2f",sum,sum/3); }
相关推荐