求n个整数的平均数
输入n,输入n个整数。输出结果(保留两位小数)。
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
double aver=0;
int a[20];
cout<<"Input n: ";
这篇博客整理了C++编程中处理整数数组的练习,重点在于将整数运算结果保留两位小数,适合C++初学者巩固基础知识。
输入n,输入n个整数。输出结果(保留两位小数)。
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
double aver=0;
int a[20];
cout<<"Input n: ";
1902
1354

被折叠的 条评论
为什么被折叠?