问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
#include<stdio.h>
int main()
{
int m, n, w, f, d;
printf("Input the number of matches:\n");
printf("Input the score:\n");
scanf("%d%d",&m,&n);
for(d=1;d<=n;++d);
{
for(w=0;w<=(n-d)/3;++w)
f=n-3w-d;
if(3w+d==n&&f+d+w==m)
printf("win:%d,draw:%d,fail:%d",w,d,f);
else
printf("No solution!");
}
return 0;
}