Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by Dmitriy ( 6 years ago )
#include <iostream>
#include <vector>
using namespace std;
int main()
{
struct cat {
int lives = 9;
int weight = 2;
cat(int lives, int weight) {
this->lives = lives;
this->weight = weight;
};
};
vector <cat> cats;
int n;
cin » n;
int lives;
int weight;
for (int i = 0; i < n; i++) {
cin » lives;
cin » weight;
cats.push_back(cat(lives, weight));
};
int maxweight = cats[0].weight;
for (int i = 1; i < n; i++) {
if (cats[i].weight > maxweight) {
maxweight = cats[i].weight;
};
};
cout « maxweight;
return 0;
}
Revise this Paste