题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int a,b[100]; float sum=0; s…… 题解列表 2025年01月25日 0 点赞 0 评论 490 浏览 评分:0.0
简易,易懂 摘要:解题思路:注意事项:参考代码:int main (){ int n; float sum=0; scanf ("%d",&n); float a[n]; for (int…… 题解列表 2024年12月03日 2 点赞 0 评论 511 浏览 评分:0.0
利用for循环求解编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; int i = 0; int m; int sum = 0; double aver = 0.0;…… 题解列表 2022年12月02日 0 点赞 0 评论 363 浏览 评分:0.0
求平均年龄 摘要:解题思路:注意事项:注意乘上1.0参考代码:#include<stdio.h>int main(){ int i,n,a[100],s=0; scanf("%d",&n); for(…… 题解列表 2022年12月25日 0 点赞 0 评论 228 浏览 评分:0.0
建立大数组,用索引循环输入,保留小数计算时用double 摘要:解题思路:如果在循环中输入,则应该先建立一个数组a[10000],后接for循环时用i做索引,cin>>a[i],这样后面计算sum +=a[i]就可以,补充double sum=0。注意事项:记得看…… 题解列表 2024年12月02日 0 点赞 0 评论 280 浏览 评分:0.0
循环控制--1.求平均年龄 摘要:解题思路: 刚开始用了数组,大小是10,我说怎么出错了呐。一看题目是1<=n<=100。这个题不用数组就很方便,for循环里面输进去一个数,然后加到sum上。注意事项:sum必须设为float型;参考…… 题解列表 2023年03月24日 0 点赞 0 评论 165 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main() { int n; scanf("%d", &n); int a[n]; for (int…… 题解列表 2023年04月25日 0 点赞 0 评论 205 浏览 评分:0.0
用数组求平均年龄 摘要:解题思路:看到别人题解可以用double a 来代替int a[100];注意事项:参考代码:#include<stdio.h>int main(){ int n; int sum = 0…… 题解列表 2024年11月03日 0 点赞 0 评论 324 浏览 评分:0.0
2794:求平均年龄 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int n,Y,i; int h=0; float y; sca…… 题解列表 2024年09月09日 0 点赞 0 评论 409 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; cin >> n; int sum = …… 题解列表 2024年02月05日 0 点赞 0 评论 164 浏览 评分:0.0