#include <iostream> #include <iomanip> using namespace std; int main(int argc, char** argv) { int renshu; float zongnianling=0; float nianling; cin>>renshu; for(int i=0;i<renshu;i++){ cin>>nianling; zongnianling+=nianling; } printf("%.2f",zongnianling/renshu); return 0; }
标签:int,平均年龄,float,renshu,nianling,include,zongnianling From: https://www.cnblogs.com/w6826301/p/17086859.html