编写题解 2794: 求平均年龄
摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main() { int n; scanf("%d", &n); int a[n]; for (int……
循环控制--1.求平均年龄
摘要:解题思路: 刚开始用了数组,大小是10,我说怎么出错了呐。一看题目是1<=n<=100。这个题不用数组就很方便,for循环里面输进去一个数,然后加到sum上。注意事项:sum必须设为float型;参考……
利用for循环求解编写题解 2794: 求平均年龄
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; int i = 0; int m; int sum = 0; double aver = 0.0;……