C++ нужна помощь много ошибок
#include <iostream> #include <string> using namespace std; struct Player { char name [50]; char player_class [50]; unsigned short int level; float exp; bool competitive; }; struct Battle { char battle_name[50]; char battle_favour_class[50]; int min_level; int xp; }; void show_player (const Player & player) { if (player.competitive ) cout<<player.name<<" is a competitive level "<<player.level <<player.player_class<<"\n"; else cout<<player.name<<" is an amateur level "<<player.level <<player.player_class<<"\n"; } void encounter(Player,Battle) { if (Player1.level && Player2.level <Battle.min_level) cout<<"Not Valid Encounter\n"; else if (Player1.level>Battle.min_level && Player2.level<Battle.min_level) cout<<"The winner is "<<Player1; else if (Player1.level<Battle.min_level && Player2.level>Battle.min_level) cout<<"The winner is "<<Player2; else if (Player1.level &&Player2.level >=Battle.min_level) cout<<"Valid Encounter"; if(Player1.player_class>Battle.battle_favour_class && Player2.player_class<Battle.battle_favour_class) cout<<"The winner is"<<Player1; else if (Player1.player_class<Battle.battle_favour_class && Player2.player_class>Battle.battle_favour_class) cout<<"The winner is"<<Player2; else if (Player1.player_class>Battle.battle_favour_class && Player2.player_class>Battle.battle_favour_class) if(Player1.exp>Player2.exp) cout<<"The winner is "<<Player1; else if(Player1.exp<Player2.xp) cout<<"The winner is "<<Player2; else if (Player1.player_class<Battle.battle_favour_class && Player2.player_class<Battle.battle_favour_class) if(Player1.exp>Player2.exp) cout<<"The winner is "<<Player1; else if(Player1.exp<Player2.exp) cout<<"The winner is "<<Player2; else if (Player1.exp=Player2.exp) cout<<"Tie"; } int exp_winner(Player,Battle); { if(Player1.level>Battle.min_level || Player1.player_class>Battle.battle_favour_class || Player1.exp>Player2.exp) Player1.exp=Player1.exp + Battle.xp else if(Player2.level>Battle.min_level || Player2.player_class>Battle.battle_favour_class || Player2.exp>Player1.exp) Player2.exp=Player2.exp + Battle.xp } int main(){ }
Что я уже пробовал:
#include <iostream> #include <string> using namespace std; struct Player { char name [50]; char player_class [50]; unsigned short int level; float exp; bool competitive; }; struct Battle { char battle_name[50]; char battle_favour_class[50]; int min_level; int xp; }; void show_player (const Player & player) { if (player.competitive ) cout<<player.name<<" is a competitive level "<<player.level <<player.player_class<<"\n"; else cout<<player.name<<" is an amateur level "<<player.level <<player.player_class<<"\n"; } void encounter(Player,Battle) { if (Player1.level && Player2.level <Battle.min_level) cout<<"Not Valid Encounter\n"; else if (Player1.level>Battle.min_level && Player2.level<Battle.min_level) cout<<"The winner is "<<Player1; else if (Player1.level<Battle.min_level && Player2.level>Battle.min_level) cout<<"The winner is "<<Player2; else if (Player1.level &&Player2.level >=Battle.min_level) cout<<"Valid Encounter"; if(Player1.player_class>Battle.battle_favour_class && Player2.player_class<Battle.battle_favour_class) cout<<"The winner is"<<Player1; else if (Player1.player_class<Battle.battle_favour_class && Player2.player_class>Battle.battle_favour_class) cout<<"The winner is"<<Player2; else if (Player1.player_class>Battle.battle_favour_class && Player2.player_class>Battle.battle_favour_class) if(Player1.exp>Player2.exp) cout<<"The winner is "<<Player1; else if(Player1.exp<Player2.xp) cout<<"The winner is "<<Player2; else if (Player1.player_class<Battle.battle_favour_class && Player2.player_class<Battle.battle_favour_class) if(Player1.exp>Player2.exp) cout<<"The winner is "<<Player1; else if(Player1.exp<Player2.exp) cout<<"The winner is "<<Player2; else if (Player1.exp=Player2.exp) cout<<"Tie"; } int exp_winner(Player,Battle); { if(Player1.level>Battle.min_level || Player1.player_class>Battle.battle_favour_class || Player1.exp>Player2.exp) Player1.exp=Player1.exp + Battle.xp else if(Player2.level>Battle.min_level || Player2.player_class>Battle.battle_favour_class || Player2.exp>Player1.exp) Player2.exp=Player2.exp + Battle.xp } int main(){ }
k5054
Мы не собираемся компилировать ваш код и исправлять ваши ошибки за вас. Вы должны рассказать нам, какие "ошибки" у вас есть, и где они находятся в коде. Возможно, тогда кто-то укажет вам на решение.
Как бы то ни было, у тебя нет тела. main()
, так что в лучшем случае программа просто завершает работу, предполагая, что она компилируется чисто.