|
发表于 2021-10-22 21:17:13
|
显示全部楼层
#include<iostream>
using namespace std;
int main()
{
float a[20];
float sum;
cout << "Input tenty numbers." << endl;
sum=0;
for(int i=0; i<20; i++)
{
cin >> a[i];
}
for(int i=0; i<20; i++)
{
sum=sum+a[i];
}
cout << "The sum of tenty numbers is " << sum << endl;
return 0;
} |
|