📄 ch27-2.c
字号:
#include<stdio.h>
#include<conio.h>
void main()
{
int money=50,count=30;
int i,j,k; /*to represent man,woman and children*/
clrscr();
printf("They consist of:\n\n");
for(i=0;i<=count;i++)
for(j=0;j<=count;j++)
for(k=0;k<=count;k++)
if(i+j+k==count&&3*i+2*j+k==money)
{
printf("man=%2d woman=%2d child=%2d\n",i,j,k);
printf("\n");
}
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -