求助,C++95分

P1909 [NOIP2016 普及组] 买铅笔

@[XPKAAA](/user/474307) 需要花费的钱数最大可能超过 $99999$,所以改一下就行了 ```cpp #include<iostream> #include<cstdlib> #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; int n,money=0x3f3f3f3f,a,b,temp; int main() { cin>>n; for(int i=1; i<=3; i++) { cin>>a>>b; if(n%a!=0) { temp=n/a+1; } else { temp=n/a; } temp*=b; money=min(money,temp); } cout<<money; return 0; } ```
by ArchaioMeles @ 2021-09-24 12:34:49


过了,谢谢提醒
by XPKAAA @ 2021-09-24 12:36:30


|