文章

59

粉丝

0

获赞

340

访问

12.6k

头像
百鸡问题 题解:for(for
P1348 哈尔滨工业大学机试
发布于2026年3月12日 13:18
阅读数 206

#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	int n;
	while(cin>>n)
	{
		for(int x=0;x<=n/5;x++)
			for(int y=0;y<=100-x;y++)
			{
				int z=100-x-y;
				if(15*x+9*y+z<=3*n)
					printf("x=%d,y=%d,z=%d\n",x,y,z);
			}
	}
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发