Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5860 | 邓小龙 | 13求7个数的平均数 | C++ | Accepted | 0 MS | 268 KB | 312 | 2024-12-19 23:30:05 |
#include<iostream> // cin\cout\endl using namespace std; int main(){ int temp,s=0;//s存7个数的总和,temp存每一个数 for(int i=1;i<=7;i++){ cin>>temp;//输入7个数 s+=temp;//对7个数求和 } cout<<s/7<<endl;//输出平均值,保留整数 return 0; }