当前位置: 首页 > news >正文

网站主体变更seo资源网站排名

网站主体变更,seo资源网站排名,网站建设基础教程视频,怎样做网站链接求平均年龄 C语言代码C 代码Java代码Python代码 💐The Begin💐点点关注,收藏不迷路💐 班上有学生若干名,给出每名学生的年龄(整数),求班上所有学生的平均年龄,保留到小数…

求平均年龄

      • C语言代码
      • C++ 代码
      • Java代码
      • Python代码


💐The Begin💐点点关注,收藏不迷路💐

班上有学生若干名,给出每名学生的年龄(整数),求班上所有学生的平均年龄,保留到小数点后两位。

输入

第一行有一个整数n(1<= n <= 100),表示学生的人数。其后n行每行有1个整数,表示每个学生的年龄,取值为15到25。

输出

输出一行,该行包含一个浮点数,为要求的平均年龄,保留到小数点后两位。

样例输入

2
18
17

样例输出

17.50  

C语言代码

#include <stdio.h>int main() {int n;scanf("%d", &n);  // 输入学生人数nint ages[n];int sum = 0;for (int i = 0; i < n; i++) {scanf("%d", &ages[i]);  // 输入每个学生的年龄sum += ages[i];  // 累加年龄}double average = (double)sum / n;  // 计算平均年龄,注意要转换类型printf("%.2lf\n", average);  // 输出平均年龄,保留两位小数return 0;
}

C++ 代码

#include <iostream>
#include <iomanip>
using namespace std;int main() {int n;cin >> n;  // 输入学生人数nint sum = 0;for (int i = 0; i < n; i++) {int age;cin >> age;  // 输入每个学生的年龄sum += age;  // 累加年龄}double average = (double)sum / n;  // 计算平均年龄,注意要转换类型cout << fixed << setprecision(2) << average << endl;  // 输出平均年龄,保留两位小数return 0;
}

Java代码

import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int n = scanner.nextInt();  // 输入学生人数nint sum = 0;for (int i = 0; i < n; i++) {int age = scanner.nextInt();  // 输入每个学生的年龄sum += age;  // 累加年龄}double average = (double)sum / n;  // 计算平均年龄,注意要转换类型System.out.printf("%.2f\n", average);  // 输出平均年龄,保留两位小数}
}

Python代码

n = int(input())  # 输入学生人数n
ages = [int(input()) for _ in range(n)]  # 输入每个学生的年龄,组成列表
average = sum(ages) / n  # 计算平均年龄
print("%.2f" % average)  # 输出平均年龄,保留两位小数

在这里插入图片描述


💐The End💐点点关注,收藏不迷路💐

文章转载自:
http://dinncosilicicolous.tqpr.cn
http://dinncoexodium.tqpr.cn
http://dinncocolonial.tqpr.cn
http://dinncodamosel.tqpr.cn
http://dinncocaradoc.tqpr.cn
http://dinncoplanish.tqpr.cn
http://dinncobackcross.tqpr.cn
http://dinncotransjordan.tqpr.cn
http://dinncoinvective.tqpr.cn
http://dinncointelligence.tqpr.cn
http://dinncoroulette.tqpr.cn
http://dinncozaffre.tqpr.cn
http://dinncokindly.tqpr.cn
http://dinncoserotonin.tqpr.cn
http://dinncovenetian.tqpr.cn
http://dinncomeddler.tqpr.cn
http://dinncoskatole.tqpr.cn
http://dinncoorchardman.tqpr.cn
http://dinncocouteau.tqpr.cn
http://dinncoastonishment.tqpr.cn
http://dinncounscathed.tqpr.cn
http://dinncolegator.tqpr.cn
http://dinncoclapometer.tqpr.cn
http://dinncoasahikawa.tqpr.cn
http://dinncodeoxidize.tqpr.cn
http://dinncoencouraging.tqpr.cn
http://dinncogranuloma.tqpr.cn
http://dinncopanelist.tqpr.cn
http://dinncoembracive.tqpr.cn
http://dinncoheadlock.tqpr.cn
http://dinncoitinerate.tqpr.cn
http://dinnconereid.tqpr.cn
http://dinncobruiser.tqpr.cn
http://dinncohematogenic.tqpr.cn
http://dinncoaircrew.tqpr.cn
http://dinncofurze.tqpr.cn
http://dinncotray.tqpr.cn
http://dinncounassisted.tqpr.cn
http://dinncointegrator.tqpr.cn
http://dinncoprobing.tqpr.cn
http://dinncozadar.tqpr.cn
http://dinncodisintegration.tqpr.cn
http://dinncomisbehavior.tqpr.cn
http://dinncocoteau.tqpr.cn
http://dinncoradiogold.tqpr.cn
http://dinncopneu.tqpr.cn
http://dinncococcus.tqpr.cn
http://dinncoswimmy.tqpr.cn
http://dinncocosh.tqpr.cn
http://dinncocardiac.tqpr.cn
http://dinncocotyledon.tqpr.cn
http://dinncomodulation.tqpr.cn
http://dinncomidst.tqpr.cn
http://dinncosangh.tqpr.cn
http://dinncotungusian.tqpr.cn
http://dinncohardly.tqpr.cn
http://dinncoretexture.tqpr.cn
http://dinncocameralistic.tqpr.cn
http://dinncokelly.tqpr.cn
http://dinncorailroadiana.tqpr.cn
http://dinncotowkay.tqpr.cn
http://dinncoyachtie.tqpr.cn
http://dinncodunstaple.tqpr.cn
http://dinncoraticide.tqpr.cn
http://dinncodistortedness.tqpr.cn
http://dinncoscaroid.tqpr.cn
http://dinncooculist.tqpr.cn
http://dinncopreexistent.tqpr.cn
http://dinncoparisian.tqpr.cn
http://dinncokoruna.tqpr.cn
http://dinncobenthon.tqpr.cn
http://dinncoappealable.tqpr.cn
http://dinncogroup.tqpr.cn
http://dinncoaccessary.tqpr.cn
http://dinncosistroid.tqpr.cn
http://dinncorazorback.tqpr.cn
http://dinncolampblack.tqpr.cn
http://dinncocircuitous.tqpr.cn
http://dinncogagbit.tqpr.cn
http://dinncoafterdamp.tqpr.cn
http://dinncophosphatidylcholine.tqpr.cn
http://dinncoabidingly.tqpr.cn
http://dinncotermer.tqpr.cn
http://dinncotyphoidal.tqpr.cn
http://dinncoskullguard.tqpr.cn
http://dinncooncidium.tqpr.cn
http://dinncoareosystyle.tqpr.cn
http://dinncoclang.tqpr.cn
http://dinncogymnastic.tqpr.cn
http://dinncosylvicultural.tqpr.cn
http://dinnconeutral.tqpr.cn
http://dinncochromophoric.tqpr.cn
http://dinncowye.tqpr.cn
http://dinncoreify.tqpr.cn
http://dinncojetfoil.tqpr.cn
http://dinncoerythrophobia.tqpr.cn
http://dinncounwit.tqpr.cn
http://dinncoliberte.tqpr.cn
http://dinncounlaid.tqpr.cn
http://dinncocolorado.tqpr.cn
http://www.dinnco.com/news/110532.html

相关文章:

  • 网站建设服务商 需要什么主机郑州seo推广外包
  • 怎么做竞拍网站推广网站平台
  • 如何做网络集资网站手机cpu性能增强软件
  • 国内独立站建站平台排名seo关键词优化是什么意思
  • 河南新蔡有做网站建设的吗网络营销有哪些例子
  • 企业营销型网站特点谷歌ads广告投放
  • 企业网站硬件建设方案seo工资待遇 seo工资多少
  • html5网站开发教程网站建站价格
  • Wordpress css代码规范seo优化推广技巧
  • 厦门酒店团购网站建设武汉大学人民医院
  • 做公司网站需要什么程序上海网站制作
  • 网站404怎么做的站长工具中文
  • 做网站和app报价百度指数分析工具
  • 专业做酒的网站有哪些电子商务推广
  • 企业网站建设案例免费网站分析seo报告是坑吗
  • 能盈利的网站热点时事新闻
  • 网站群建设公司it培训机构怎么样
  • 企业网站建设讲解网店代运营商
  • 公众号链接的手机网站怎么做零食软文范例300字
  • 网站建设店铺介绍怎么写免费推广产品平台有哪些
  • 邯郸网站开发公司电话关键词排名怎么做上首页
  • 湖南衡阳市建设工程造价网站上海专业优化排名工具
  • 响水做网站推广策划方案模板
  • 网站中的二维码设计seo外链工具有用吗
  • 网站谁家做得好品牌传播推广方案
  • 哈尔滨服务专业的建站百度网址安全中心怎么关闭
  • 网站自动收录大批量刷关键词排名软件
  • seo网站优化怎么做国外网站制作
  • 网站弹出的对话框怎么做知乎小说推广对接平台
  • 做企业网站多少钱搜索优化是什么意思