建立大数组,用索引循环输入,保留小数计算时用double 摘要:解题思路:如果在循环中输入,则应该先建立一个数组a[10000],后接for循环时用i做索引,cin>>a[i],这样后面计算sum +=a[i]就可以,补充double sum=0。注意事项:记得看…… 题解列表 2024年12月02日 0 点赞 0 评论 541 浏览 评分:0.0
用数组求平均年龄 摘要:解题思路:看到别人题解可以用double a 来代替int a[100];注意事项:参考代码:#include<stdio.h>int main(){ int n; int sum = 0…… 题解列表 2024年11月03日 0 点赞 0 评论 597 浏览 评分:0.0
2794:求平均年龄 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int n,Y,i; int h=0; float y; sca…… 题解列表 2024年09月09日 0 点赞 0 评论 635 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int n,sum=0; cin>>n; …… 题解列表 2024年06月16日 1 点赞 0 评论 832 浏览 评分:9.9
java求平均年龄 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args) {…… 题解列表 2024年04月21日 0 点赞 0 评论 399 浏览 评分:0.0
六行简便 编写题解 2794: 求平均年龄 摘要:解题思路:a=list(map(int,input().split()))注意事项:将输入一行表示参考代码:n=int(input())a=list(map(int,input().split()))…… 题解列表 2024年04月06日 2 点赞 0 评论 1340 浏览 评分:10.0
python编写题解 2794: 求平均年龄 摘要:参考代码:n = map(int, input().split()) n = list(n) if len(n) == 1: ages = [int(input()) for i in …… 题解列表 2024年03月11日 1 点赞 0 评论 674 浏览 评分:2.0
题解 2794: 求平均年龄 摘要:解题思路:套个循环……注意事项:别抄我的,抄我的人我诅咒他电脑立刻关机参考代码:#include<bits/stdc++.h>#include<windows.h>using namespace st…… 题解列表 2024年02月23日 0 点赞 0 评论 610 浏览 评分:6.0
求平均年龄 摘要:解题思路:用循环输入各个年龄,累加和注意事项:保留两位小数参考代码:#include<stdio.h>int main(){ int n,i,sum=0,age; scanf("%d",&…… 题解列表 2024年02月18日 0 点赞 0 评论 505 浏览 评分:7.3
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; cin >> n; int sum = …… 题解列表 2024年02月05日 0 点赞 0 评论 327 浏览 评分:0.0