竞赛
考级
#include <iostream> using namespace std; int main(){ int n,x,y,a; cin >> n >> x >> y; //(y%x == 0)?a = y/x:a = y/x+1; if (x >= 0 && x <= 99999 && n >= 0 && n <= 99999 && y >= 0 && y <= 99999) { a = y/x; if (y%x != 0) a++; }
#include<iostream> using namespace std; int main(){ int n; int x; int y; cin>>n>>x>>y; if(y%x!=0){ cout<<n-y/x-1; }else{ if(n-y/x<=0){ cout<<"0"; }else{ cout<<n-y/x;} } return 0; }
#include<bits/stdc++.h> using namespace std; int m,t,s; int main() { cin>>m>>t>>s; if(t0) { cout<<0<<endl; return 0; } if(s%t0) cout<<max(m-s/t,0)<<endl; else cout<<max(m-s/t-1,0)<<endl; return 0; }
#include<iostream> using namespace std; int main(){ int n; int x; int y; cin>>n>>x>>y; if(y%x!=0){ cout<<n-y/x-1; } else{ if(n-y/x<=0){ cout<<"0"; } else{ cout<<n-y/x;} } return 0; }
共68条
提交答案之后,这里将显示提交结果~