Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int N;
- cin >> N;
- int kupeni_proizvodi [N][2];
- for(int i = 0; i < N; i++)
- {
- for(int j = 0; j < 2; j++)
- {
- cin >> kupeni_proizvodi[i][j];
- }
- }
- int zelka = 0;
- int morkov = 0;
- for (int i = 0; i < N; i++)
- {
- zelka += kupeni_proizvodi[i][0];
- morkov += kupeni_proizvodi[i][1];
- }
- if (zelka > morkov)
- {
- cout << "zelka" << endl;
- cout << zelka << endl;
- }
- else {cout << "morkov" << endl;
- cout << morkov << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement