###### 求知 求是

2017-11-07 03:23 阅读 4.4k

# 如何用C写博弈论之Best Response？

Input percent of A and B:0.2 0.8↙
compete = 6.8000
standard = 9.6000
The Best Response is standard!

• 点赞
• 写回答
• 关注问题
• 收藏
• 复制链接分享

#### 2条回答默认 最新

• 国科大小渣渣 2019-01-01 12:08

#include
#include

int main()
{
float PerscentA,PerscentB,Profit1,Profit2;
printf("Input percent of A and B:");
scanf("%f,%f",&PerscentA,&PerscentB);
Profit1 = PerscentA*10 + PerscentB*6;
Profit2 = PerscentA*8+PerscentB*10;
printf("compete = %.4f\nstandard = %.4f\n",Profit1,Profit2);
if(Profit1 > Profit2)
printf("The Best Response is compete!");
else
printf("The Best Response is standard!");

``````return 0;
``````

}

点赞 评论 复制链接分享
• 生如-格桑 2018-04-13 14:46

#include
main()
{float a,b,compete,standard;
printf("Input percent of A and B:");
scanf("%f%f",&a,&b);
compete=a*10+b*6;
standard=a*8+b*10;
printf("compete = %.4f\nstandard = %.4f\n",compete,standard);
if(compete>= standard){
printf("The Best Response is compete!");}
else
printf("The Best Response is standard!");
}

点赞 评论 复制链接分享