Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // pokemon2.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- int main()
- {
- int N = 0; // broj pokemona
- string pi; //naziv pokemona
- int Ki, Mi = 0; // slatkisi potrebno za 1 evoluiranje i ukupno trenutno
- int i = 1; // brojac za petlju preko broja pokemona
- int counter = 0; // broji evoluiranje
- int counter2 = 0; // broji counter
- vector <string> imena;
- //unos br poekemona
- cin >> N;
- do {
- cin >> pi; // unos imena
- imena.push_back(pi);
- cin >> Ki >> Mi; // unos slatkisa
- if(Mi >= Ki) {
- Mi = (Mi - Ki) + 2;
- counter++; // broji evoluiranje
- }
- counter2 += counter; // broji countere
- i++;
- } while (i <= N);
- cout << counter2;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement