-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path5_8.cpp
More file actions
23 lines (23 loc) · 717 Bytes
/
5_8.cpp
File metadata and controls
23 lines (23 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<iostream>
int main()
{
using namespace std;
cout << "The Amazing Accounto will sum and average ";
cout << "five numbers fir you.\n";
cout << "Please enter five values:\n";
double number;
double sum = 0.0;
for (int i = 1; i <= 5; i++)
{ //Óï¾ä¿é¿ªÊ¼
cout << "Value " << i << ": ";
cin >> number;
sum += number;
} //Óï¾ä¿é½áÊø
cout << "Five exquisite choices indeed! ";
cout << "They sum to " << sum << endl;
cout << "and average to " << sum / 5 << ".\n";
cout << "The Amazing Accounto bids you adieu!\n";
cin.get();
cin.get();
return 0;
}