为什么有3个WA!其他AC!

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

s/t向下取整導致結果少一,應該判斷是否整除,是就a=s/t,不然a=s/t+1
by IMPOSTORrrrrrr @ 2023-09-29 14:33:25


就像這樣 ```c #include<iostream> using namespace std; int m,t,s,c; int main(){ cin>>m>>t>>s; if(t==0)cout<<0; else{ if(s%t==0)c=s/t; else c=s/t+1; m-=c; if(m<0)m=0; cout<<m; } } ```
by IMPOSTORrrrrrr @ 2023-09-29 14:34:31


@[IMPOSTORrrrrrr](/user/1067755) 谢谢 , AC了
by Harry2023 @ 2023-09-29 14:46:15


|