- 分享
【基础题】截钢管
- 2023-9-2 15:43:17 @
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a=369,b=69,c=39;
int num69=0,num39=0,min=39; a=a-b;
for(int i=1;a>b+c;a=a-b,i++)
{
int j=a/c;
if(min>a-j*c)
{
num69=i;
num39=j;
min=a-j*c;
}
}
cout<<num69<<" "<<num39<<" "<<min;
return 0;
}
0 comments
No comments so far...