Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i;
- double sum1 = 0;
- int k;
- double sum2 = 0;
- int t;
- for (i=1; i<=12; i++){
- cout << "Enter the area of the " << i << " district in sq km: " << endl;
- cin >> k;
- sum1 += k;
- }
- for (i=1; i<=12; i++){
- cout << "Enter the number of people of the " << i << " district: " << endl;
- cin >> t;
- sum2 += t;
- }
- double ratio = sum2/sum1;
- cout << "Average population density in the region: " << ratio ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement