#include<iostream>
#include<cstdio>
#include<cstring>
#include<windows.h>
//#include<graphics.h>
using namespace std;
double ss(int s[],int n);
double cm(int s[],int n);
double cb(int s[],int n);
double count(double a,int b);
void color(int x)//字体颜色
{
if(x>=0&&x<=15)
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),x);
else
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),7);
}
void cshcxhs();
//void far settextstyle(int font,int direction,char size);
struct shuju //结构体
{
string name;
string weizhi;
string country;
int year;
}player;
int main()//主函数
{
cshcxhs();
double money;
string nengli[5]={"攻击意识","防守意识","盘带射门","防守技巧","身体素质"};
int a,s[5];
cout<<"球员姓名: ";cin>>player.name;cout<<endl;
cout<<"国籍: ";cin>>player.country;cout<<endl;
cout<<"年龄: ";cin>>player.year;cout<<endl;
cout<<"前锋:ss,中场cm,后卫cb"<<endl;
cout<<"位置: ";cin>>player.weizhi;cout<<endl;
for(int i=0;i<5;i++)
{
cout<<nengli[i]<<": ";
cin>>s[i];
cout<<endl;
}
if(player.weizhi=="ss")
{
money=ss(s,5);
money=count(money,player.year);
cout<<money<<"亿欧元";
}
if(player.weizhi=="cm")
{
money=cm(s,5);
money=count(money,player.year);
cout<<money<<"亿欧元";
}
if(player.weizhi=="cb")
{
money=cb(s,5);
money=count(money,player.year);
cout<<money<<"亿欧元";
}
}
double ss(int s[],int n)//前锋
{
double money=0,r=s[0]+s[2]+s[4];
if(r>=240)
{
money=1.0*r/300*1.8;
}
else if(r>=210)
money=1.0*r/300*0.8;
if(r<210)
money=1.0*r/300*0.3;
return money;
}
double cm(int s[],int n)//中场
{
double money=0;
for(int i=0;i<5;i++)
{
money=money+s[i];
}
if(money>=400)
money=1.0*money/500*1.2;
if(money<400)
{
for(int i=0;i<5;i++)
{
if(s[i]>=90)
break;
if(i==4)
{
money=1.0*money/500*0.6;
return money;
}
}
money=1.0*money/500*0.9;
}
return money;
}
double cb(int s[],int n)//后卫
{
double money=0,r=s[1]+s[3]+s[4];
if(r>=270)
{
money=1.0*r/300*1.1;
}
else if(r>240)
money=1.0*r/300*0.8;
if(r<240)
money=1.0*r/300*0.6;
return money;
}
double count(double a,int b)//年龄折算
{
if(b>35)
a=a*0.1;
if(b<=35&&b>28)
a=a*0.5;
if(b<=28)
a=a;
return a;
}
void cshcxhs() //开场画面
{
//settextstyle(4,0,6);
system("title 曼联勇往直前");
//color(71) ;
system("color 71");
cout<<" ****** * ****** * "<<endl;
cout<<" * * * * * "<<endl;
cout<<" * * * * * "<<endl;
cout<<" ***** * ***** * * "<<endl;
cout<<" * * * * *** * "<<endl;
cout<<" * * * * * "<<endl;
cout<<" * * * * * "<<endl;
Sleep(2000);
system("cls");
}
//自己根据实况2021估计的数据,仅做娱乐判断