为什么通过率只有80%
#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b,x=0; cin>>n>>a>>b; for(int i=b;i>=0;i--) { for(int j=a;j<=n;j++) { if(i+j==n) x++; } } cout<<x; }
扫描二维码,关注牛客
下载牛客APP,随时随地刷题
全部评论
(1) 回帖