竞赛
考级
哪位大佬能告诉我怎么错了?
不会的可以用实物试一试
有空多刷刷水题
哪位大佬可以告诉我哪里错了? #include <iostream> using namespace std; int main(){ int x,n,y,a; cin>>n>>x>>y; a=y/x; if (a%1==0){ cout<<a; } else{ a=(x+y-1)/4; cout<<n-a; } return 0; }
大佬教一下 #include <iostream> #include <cmath> using namespace std; int main() { int n,x,y; double i; cin>>n>>x>>y; i=n-ceil(y*1.0/x); cout<<i<<endl; } 前两个是WA
大佬救我!!!
虫子:这差事不错 苹果:你不要过过来来啊啊!!
有谁给我下思路?
为什么if(y%x!=0){ cout<<n-y/x-1; } if(n-y/x<=0){ cout<<"0"; }
#include <iostream> using namespace std; int main(){ int n,x,y; cin>>n >>x>>y; if(y%x==0){ if(n-y/x>0){ cout << n-y/x; }else{ cout << 0; } }else{ cout << n-y/x-1; } return 0;好习惯 }
提交答案之后,这里将显示提交结果~