c++编译失败求助。在vs可以运行但测评一章说编译失败。求大佬看看

P5709 【深基2.习6】Apples Prologue / 苹果和虫子

system删了试试
by PorkSausage @ 2023-12-05 23:00:55


@[zrczrczrczrc](/user/974277) 还是不行啊TAT
by AME2014 @ 2023-12-06 17:28:02


可以这样: ```c #include<bits/stdc++.h> using namespace std; int main() { int m,t,s; scanf("%d%d%d",&m,&t,&s);//C语言输入 if(t==0) { printf("0"); return 0; } if(s%t==0) { if(m-s/t<=0) { printf("0"); return 0; } printf("%d",m-s/t);//C语言输出 } else { if(m-s/t+1<=0) { printf("0"); return 0; } printf("%d",m-s/t-1); } return 0; } ``` 有几点要注意: | 数据 |输出 | | -----------: | -----------: | |20 34 1000 |0 | |100 0 1 | 0 | (花几天下载出来的数据)
by chenzhenghao02 @ 2023-12-07 17:24:24


@[chenzhenghao02](/user/1072779) 谢谢大佬TAT所以我的代码为什么会编译失败啊,明明在vs上还可以运行的
by AME2014 @ 2023-12-07 22:10:46


换万能头文件试试 ```c #include<bits/stdc++.h> using namespace std; int main() { return 0; } ```
by chenzhenghao02 @ 2023-12-07 22:21:38


|