Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // monitos.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <vector>
- #include <string>
- #include <iostream>
- using namespace std;
- double nok = 2.422;
- int antallPersoner;
- vector<int> tall;
- vector<string> folk;
- double sum = 0;
- double perPers;
- int main()
- {
- cin >> antallPersoner;
- for(int j = 0; j < antallPersoner; j++)
- {
- int k;
- cin >> k;
- double y = k * 2.422;
- cout << y << endl;
- }
- for(int i = 0; i < antallPersoner; i++)
- {
- int curPris;
- string navn;
- cin >> navn >> curPris;
- tall.push_back(curPris);
- folk.push_back(navn);
- sum += curPris;
- }
- cout << "----------" << endl;
- perPers = sum / antallPersoner;
- cout << "Per person: " << perPers << endl << "----------" << endl;
- for(int i = 0; i < antallPersoner; i++)
- {
- cout << folk[i] << " : " << (tall[i]-perPers) << endl;
- }
- cin >> perPers;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement