ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Структуры, указатель, динамический массив
Posted by Chika 11 Dec 2018 22:10
Create struct:

struct Animal which has:
- ID // ID of hero
- name // name of animal (char *) (cin.getline) (cin.ignore())
- strength(int) // power of animal
- frequency // number of hits in one iteration
- HP // amount of life

Your task is to show animal which won most rounds in the game.

Input:
n (how many animals) [2 <= n <= 10]
n-times:
ID
name
strength
frequency goals
HP goals
Output:
winner with amount of victory.

Example:

Input:
10
1 Lion John 30 2 100 // (0 1 0 0 1 0 1 0 0) 3 victory
2 Hen Rebecca 60 1 200 // (1 1 1 0 1 0 1 0 1) 6 victory
3 Tiger Alex 40 2 100 // (1 0 0 0 1 0 1 0 1) 4 victory
4 Buffalo James 40 3 100 // (1 1 1 0 1 0 1 0 1) 6 victory
5 Elephant Jack 50 1 300 // (1 1 1 1 1 0 1 0 1) 7 victory
6 Rhino Michael 30 1 200 // (1 0 0 0 0 0 1 0 0) 2 victory
7 Snake Oz 50 2 400 // (1 1 1 1 1 1 1 1 1) 9 victory
8 Cow Bettie 40 1 100 // (0 0 0 0 0 0 0 0 0) 0 victory
9 Crocodile Nick 20 3 500 // (1 1 1 1 1 1 0 1 1) 8 victory
10 Bear Drake 40 2 150 // (1 1 1 1 0 1 0 1 0) 6 victory

Output :
7 Snake Oz 50 2 400 9 victory