C语言编程
题
快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题
精选
1、 编程实现对键盘输入的英文名句子进行加密。用加密方法为,当
内容
财务内部控制制度的内容财务内部控制制度的内容人员招聘与配置的内容项目成本控制的内容消防安全演练内容
为英文字母时其在26字母中的其后三个字母代替该字母,若为其它字符时不变。
2、 编程实现将任意的十进制整数转换成R进制数(R在2-16之间)。
3、 从键盘输入一指定金额(以元为单位,如345.78),然后显示支付该金额的各种面额人民币数量,要求显示100元、50元、10元、5元、2元、1元、5角、1角、5分、1分各多少张。 (输出面额最大值:比如345.78=100*3+10*4+5*1+0.5*1+0.1*2+0.01*8)
4、 随机产生20个[10,50]的正整数存放到数组中,并求数组中的所有元素最大值、最小值、平均值及各元素之和。
5、 编程在一个已知的字符串中查找最长单词,假定字符串中只含字母和空格,空格用来分隔不同单词
6、 模拟n个人参加选举的过程,并输出选举结果:假设候选人有四人,分别用A、B、C、D
表
关于同志近三年现实表现材料材料类招标技术评分表图表与交易pdf视力表打印pdf用图表说话 pdf
示,当选某候选人时直接输入其编号(编号由计算机随机产生),若输入的不是A、B、C、D则视为无效票,选举结束后按得票数从高到低输出候选人编号和所得票数。
7、任何一个自然数m的立方均可写成m个连续奇数之和。例如:
1^3=1
2^3=3+5
3^3=7+9+11
4^3=13+15+17+19
编程实现:输入一自然数n,求组成n3的n个连续奇数。
8、 知abc+cba=1333,其中a,b,c均为一位数,编程求出满足条件的a,b,c所有组合
9、编制一个完成两个数的四则运算程序。如:用户输入34+56则输出结果90.00。要求运算结果保留两位小数,用户输入时一次将两个数和操作符输入。
10、输入一个五位以内的正整数,(1)判断它是一个几位数;(2)请按序输出其各位数字;(3)逆序输出其各位数字。
如输入:56439,输出:5位数
5,6,4,3,9
9,3,4,6,5
11、编写子函数:(1)用冒泡法将一个数组排成升序的函数---SUB1;(2)在升序数组中插入一个数,并且保持该数组仍为升序数组的函数---SUB2。
主函数:①输入任意10个正整数给数组;②调用SUB1对数组进行排序;③从键盘输入一个正整数,调用SUB2将其插入该数组。
12、编写函数:(1)用选择法将数组排成降序的函数----SUB1;(2)用折半查找法查找某数是否在给定的数组当中的函数----SUB2。
主函数:输入任意10个正整数给数组,调用SUB1对数组进行排序,从键盘输入一个正整数,调用SUB2在数组中进行查找,找到后输出“OK”,没有找到则输出“NO FOUND!”。
13、编写一个程序,输入两个包含5个元素的数组,先将两个数组升序排列,然后将这两个数组合并成一个升序数组。
14、耶稣有13个门徒,其中有一个就是出卖耶稣的叛徒,请用排除法找出这位叛徒:13人围坐一圈,从第一个开始报号:1,2,3,1,2,3……,凡是报到“3”就退出圈子,最后留在圈内的人就是出卖耶稣的叛徒,请找出它原来的序号。
15、按如下图形打印杨辉三角形的前10行。其特点是两个腰上的数都为1,其它位置上的每一个数是它上一行相邻两个整数之和。
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
……
16、某班有5个学生,三门课。分别编写3个函数实现以下要求:
(1) 求各门课的平均分;
(2) 找出有两门以上不及格的学生,并输出其学号和不及格课程的成绩;
(3) 找出三门课平均成绩在85-90分的学生,并输出其学号和姓名
主程序输入5个学生的成绩,然后调用上述函数输出结果。
17、编写一人个求X的Y次幂的递归函数,X为double型,y为int型,要求从主函数输入x,y的值,调用函数求其幂。
18、打印魔方阵。
所谓魔方阵是指这样的的方阵:
它的每一行、每一列和对角线之和均相等。
输入n,要求打印由自然数1到n2的自然数构成的魔方阵(n为奇数)。
例如,当n=3时,魔方阵为:
8 1 6
3 5 7
4 9 2
魔方阵中各数排列规律为:
① 将“1”放在第一行的中间一列;
② 从“2”开始直到n×n为止的各数依次按下列
规则
编码规则下载淘宝规则下载天猫规则下载麻将竞赛规则pdf麻将竞赛规则pdf
存放:每一个数存放的行比前一个数的行数减1,列数同样加1;
③ 如果上一数的行数为1,则下一个数的行数为n(最下一行),如在3×3 方阵中,1在第1行,则2应放在第3行第3列。
④ 当上一个数的列数为n时,下一个数的列数应为1,行数减1。如2在第3行第3列,3应在第2行第1列。
⑤如果按上面规则确定的位置上已有数,或上一个数是第1行第n列时,则把下一个数放在上一个数的下面。如按上面的规定,4应放在第1行第2列,但该位置已被1占据,所以4就放在3的下面。由于6是第1行第3列(即最后一列),故7放在6下面。
19、找出一个二维数组中的“鞍点”,即该位置上的元素在该行中最大,在该列中最小(也可能没有“鞍点”),打印出有关信息。
20、马克思在《数学手稿》中提出如下问题:有30个人(包括男人、女人和小孩)在一家饭店吃饭共花50先令,其中每个男人花3先令,每个女人花2先令,每个小孩花1先令,问男人、女人、小孩各有多少人?
21、定义一个结构体变量(包括年、月、日),计算该日在本年中为第几天?(注意考虑闰年问题),要求写一个函数days,实现上面的计算。由主函数将年月日传递给days函数,计算后将日子传递回主函数输出。
22、建立一个链表,每个结点包括:学号、姓名、性别、年龄,输入一个学号,如果链表中的结点包括该学号,则输出该结点内容后,并将其结点删去。
23、给定一个日期,求出该日为星期几(已知2002-3-28为星期四)。
24、用递归法将一个整数n转换成字符串(例如输入4679,应输出字符串“4679”),n为不确定数,可以是位数不超过5,且数值在-32768~32767之间和任意整数。
25、有一个字符串,包括n个字符。写一个函数,将此字符串从第m个字符开始的全部字符复制成另一个字符串。要求在主函数输入字符串及m值并输出复制结果。
26、在主函数中输入6个字符串,用另一个函数对他们按从小到大的顺序,然后在主函数中输出这6个已经排好序的字符串。要求使用指针数组进行处理。
27、编写一个函数实现对两个字符串的比较。不用使用C语言提供的
标准
excel标准偏差excel标准偏差函数exl标准差函数国标检验抽样标准表免费下载红头文件格式标准下载
函数strcmp。要求在主函数中输入两个字符串,并输出比较的结果(相等的结果为0,不等时结果为第一个不相等字符的ASCII差值)。
28、有一个unsigned long型整数,先要分别将其前2个字节和后2个字节用为两个unsigned int型整数输出(设一个int型数据占2个字节),试编写一函数partition实现上述要求。要求在主函数输入该long型整数,在函数partition中输出结果。
29、编一程序,能把从终端读入的一个字符中的小写字母全部转换成大写字母,然后输出到一个磁盘文件“test”中保存(用字符!表示输入字符串的结束)。
30、有五个人坐在一起,问第5个人多少岁?他说比第4个人大2岁。问第4个人多少岁?他说比第3个人大2岁。问第3个人多少岁?他说比第3个人大2岁。问第2个人多少岁?他说比第1个人大2岁。最后问第1个人多少岁?他说是10岁。请问第5个人多大?(这是一个递归问题)
参考答案
1、编程实现对键盘输入的英文名句子进行加密。用加密方法为,当内容为英文字母时其在26字母中的其后三个字母代替该字母,若为其它字符时不变。
#include
main()
{char c;
printf("please input a string:");
while((c=getchar())!='\n')
{ if(c>='A'&&c<='W'||c>='a'&&c<='w') c=c+3;
else if(c>='X'&&c<='Z'||c>='x'&&c<='z') c=(c+3)-26;
printf("%c",c);
}
printf("\n");
return 0;
}
2、编程实现将任意的十进制整数转换成R进制数(R在2-16之间)。
#include
#include
void main()
{
int n,R,i=0,a[16]={0};
char str[16]="0123456789ABCDEF";
clrscr();
printf("please input an integer number:\n");
scanf("%d",&n);
printf("please input R:\n");
scanf("%d",&R);
if(n<0)
{
printf("%c",'-');
n=-n;
}
while(n!=0)
{
a[i++]=n%R;
n=n/R;
}
while(i-->0)
printf("%c",str[a[i]]);
getche();
}
3、从键盘输入一指定金额(以元为单位,如345.78),然后显示支付该金额的各种面额人民币数量,要求显示100元、50元、10元、5元、2元、1元、1角、5分、1分各多少张。
#include
main()
{ int a1,a2,a3,a4,a5,a6,a7,a8,a9;
float f;
a1=a2=a3=a4=a5=a6=a7=a8=a9=0;
printf("please input a float number:");
scanf("%f",&f);
while(f>100.0)
{ f=f-100.0;
a1++;
}
while(f>50.0)
{ f=f-50.0;
a2++;
}
while(f>10.0)
{ f=f-10.0;
a3++;
}
while(f>5.0)
{ f=f-5.0;
a4++;
}
while(f>1.0)
{ f=f-1.0;
a5++;
}
while(f>0.5)
{ f=f-0.5;
a6++;
}
while(f>0.1)
{ f=f-0.1;
a7++;
}
while(f>0.05)
{ f=f-0.05;
a8++;
}
while(f>0.01)
{ f=f-0.01;
a9++;
}
printf("a1=%d, a2=%d, a3=%d, a4=%d, a5=%d, a6=%d, a7=%d, a8=%d, a9=%d\n", a1,a2,a3,a4,a5,a6,a7,a8,a9);
return 0;
}
4、随机产生20个[10,50]的正整数存放到数组中,并求数组中的所有元素最大值、最小值、平均值及各元素之和。
#include
#include
void main()
{
int a[21],i,ran,max,min,sum,average;
clrscr();
for (i=1;i<=20;i++)
{
while((ran=random(51))/10==0) //ensure ran between 20 and 50 ;
a[i]=ran;
}
max=min=a[1]; // initialize here
sum=0;
for(i=1;i<=20;i++)
{
printf("a[%d]=%d\n",i,a[i]);
sum+=a[i];
if(maxa[i])
min=a[i];
}
average=sum/20;
printf("\nsum=%d, max=%d, min=%d, average=%d \n",sum,max,min,average);
puts("\nany key to exit!");
getche();
}
5、编程在一个已知的字符串中查找最长单词,假定字符串中只含字母和空格,空格用来分隔不同单词。
#include
#include
void main()
{
char string[80],*p;
int i=0,max=0;
clrscr();
printf("please input a string:\n");
gets(string);
// printf("\n%s\n",string);
p=string;
while(*p!='\0')
{
if(*p==' ')
{
if(max<=i)
max=i;
i=0;
}
else
i++;
p++;
}
if(max<=i)
max=i;
printf("\nmax_length of the string is: %d \n",max);
getche();
}
7、 模拟n个人参加选举的过程,并输出选举结果:假设候选人有四人,分别用A、B、C、D表示,当选某候选人时直接输入其编号(编号由计算机随机产生),若输入的不是A、B、C、D则视为无效票,选举结束后按得票数从高到低输出候选人编号和所得票数。
#include
#include
#include
#include
void main()
{
int i,n,A,B,C,D,abandon,ran; //abandon stand for the ones who abandon
clrscr();
A=B=C=D=abandon=0;
printf("Enter the number of persons:");
scanf("%d",&n); //n persons to select from candidate a,b,c and d.
randomize();
for(i=1;i<=n;i++)
{
ran=random(5)+65; //A,B,C,D and the ones who abandon
switch(ran)
{
case 'A':A++;break;
case 'B':B++;break;
case 'C':C++;break;
case 'D':D++;break;
default :abandon++;
}
}
printf("\nA=%d,B=%d,C=%d,D=%d,abandon=%d\n\n",A,B,C,D,abandon);
i=4;
while(i--!=0)
{
if(A>=B&&A>=C&&A>=D&&A!=-1)
{
printf("A=%d,",A);
A=-1;
}
if(B>=A&&B>=C&&B>=D&&B!=-1)
{
printf("B=%d,",B);
B=-1;
}
if(C>=A&&C>=B&&C>=D&&C!=-1)
{
printf("C=%d,",C);
C=-1;
}
if(D>=A&&D>=B&&D>=C&&D!=-1)
{
printf("D=%d,",D);
D=-1;
}
}
printf("abandon=%d, \n\n",abandon);
getch();
}
7.任何一个自然数m的立方均可写成m个连续奇数之和。例如:
1^3=1
2^3=3+5
3^3=7+9+11
4^3=13+15+17+19
编程实现:输入一自然数n,求组成n3的n个连续奇数。
#include
#include
#include //
void main()
{
int i,j,n,sum,count;
clrscr();
printf("\n an integer here please:");
scanf("%d",&n);
printf("\n");
// i=(int)floor(sqrt((float)n));
// if(i%2==0)
// i++;
i=1; //
for(;i<=n*n*n;i+=2)
{
sum=0;
count=0;
for(j=i;j<=n*n*n;j+=2)
{
sum=sum+j;
count++;
if((n*n*n==sum)&&(count==n))
break;
}
if((sum==n*n*n)&&(count==n))
break;
}
printf("i=%d,j=%d\n\n",i,j);
printf("%d*%d*%d=",n,n,n);
// while(n-->1) { printf("%d+",i); i+=2; }
for(;i
#include
void main()
{
int num,a,b,c;
clrscr();
printf("Press any key to calculate!\n\n");
getch();
for(num=101;num<1000;num++)
{
a=num/100;
b=num%100/10;
c=num%10;
if(num+c*100+b*10+a==1333)
printf("\n%d+%d=1333\n",num,c*100+b*10+a);
}
while(!kbhit()) ;
}
8、 编制一个完成两个数的四则运算程序。如:用户输入34+56则输出结果90.00。要求运算结果保留两位小数,用户输入时一次将两个数和操作符输入。
#include
#include
void main()
{
float num1,num2;
char s;
clrscr();
printf("Enter a statement please:");
scanf("%f%c%f",&num1,&s,&num2);
switch(s)
{
case '+':printf("%.2f%c%.2f=%.2f",num1,s,num2,num1+num2);break;
case '-':printf("%.2f%c%.2f=%.2f",num1,s,num2,num1-num2);break;
case '*':printf("%.2f%c%.2f=%.2f",num1,s,num2,num1*num2);break;
case '/':printf("%.2f%c%.2f=%.2f",num1,s,num2,num1/num2);break;
default: printf("Input Error!");
}
getch();
9、 }
10、 输入一个五位以内的正整数,(1)判断它是一个几位数;(2)请按序输出其各位数字;(3)逆序输出其各位数字。
如输入:56439,输出:5位数
5,6,4,3,9
9,3,4,6,5
#include
#include
long power(int n)
{
int i;
long result=1;
for(i=1;i<=n;i++)
result=10*result;
return result;
}
void main()
{
long num,n,j;
int count=1,tmpcount;
clrscr();
printf("Please input a number(0-99999):");
scanf("%ld",&num);
n=num;
while((n=n/10)!=0)
count++;
printf("\n%ld is a %d digits.\n\n",num,count);
tmpcount=count; //temporary tmpcount for later use in statement A
n=num;
while(count-->1)
{
j=power(count);
printf("%d, ",n/j);
n=n%j;
}
printf("%d\n",n);
n=num;
while(tmpcount-->1) // statement A
{
printf("%d, ",n%10);
n=n/10;
}
printf("%d\n",n);
getch();
11、 }
12、 编写子函数:(1)用冒泡法将一个数组排成升序的函数---SUB1;(2)在升序数组中插入一个数,并且保持该数组仍为升序数组的函数---SUB2。 主函数:①输入任意10个正整数给数组;②调用SUB1对数组进行排序;③从键盘输入一个正整数,调用SUB2将其插入该数组。
#include
#include
void main()
{
int i,k,a[12]={0}; //a[0] for no use
void sub1(int b[]),sub2(int b[],int k);
clrscr();
printf("Please input 10 numbers:");
for(i=1;i<=10;i++)
scanf("%d",&a[i]);
getchar();
sub1(a);
for(i=1;i<=10;i++)
printf("\na[%d]=%d\n",i,a[i]);
printf("\n\nplease input a number to be inserted into the array:");
scanf("%d",&k);
sub2(a,k);
for(i=1;i<=11;i++)
printf("\na[%d]=%d\n",i,a[i]);
puts("\nAny key to exit!");
getch();
}
void sub1(b)
int b[];
{
int i,j,t;
for (i=1;i<10;i++) //the first one is always the smallest
for(j=i;j<=10;j++)
if (b[i]>b[j])
{
t=b[i];
b[i]=b[j];
b[j]=t;
}
}
void sub2(int b[],int k)
{
int i;
for(i=10;i>=1;i--)
{
if(k
#include
void main()
{
int i,key,a[11]={0},sub1(),sub2();
printf("please input 10 number: ");
for(i=1;i<=10;i++)
scanf("%d",&a[i]);
getchar();
sub1(a);
for(i=0;i<=10;i++)
printf("a[%d]=%d ,",i,a[i]);
printf("\n please input a key number: ");
scanf("%d",&key);
sub2(a,key,1,10);
getch();
}
int sub1(int b[])
{
int t,i,j,post;
for (i=1;i<10;i++)
{
post=i;
for(j=i+1;j<=10;j++)
if (b[post]>b[j])
post=j;
if(post!=i)
{
t=b[i];
b[i]=b[post];
b[post]=t;}
}
return 0;
}
int sub2(int c[],int k,int n0,int n1)
{
int i=n0,j=n1,m;
m=(i+j)/2;
while(i<=j)
{
if(kc[m])
i=m+1;
if(k==c[m])
break;
m=(i+j)/2;
}
if(k==c[m])
printf("OK!\n") ;
else
printf("NO FOUND!\n");
return 0;
}
14、 编写一个程序,输入两个包含5个元素的数组,先将两个数组升序排列,然后将这两个数组合并成一个升序数组。
#include
#include
void main()
{
int i,j,k,a[6]={0},b[6]={0},c[11]={0},sub1();
clrscr();
printf("\nplease input 5 int numbers to array1: ");
for(i=1;i<=5;i++) //a[0] for no use
scanf("%d",&a[i]);
getchar();
sub1(a,5);
printf("\nplease input 5 int numbers to array2: ");
for(i=1;i<=5;i++) //b[0] for no use
scanf("%d",&b[i]);
getchar();
sub1(b,5);
printf("\nthe sorted array a is:\n\n");
for(i=1;i<=5;i++)
printf("a[%d]=%d ",i,a[i]);
printf("\n");
printf("\nthe sorted array b is:\n\n");
for(i=1;i<=5;i++)
printf("b[%d]=%d ",i,b[i]);
k=i=j=1;
while(i<=5&&j<=5)
if(a[i]b[j])
post=j;
if(post!=i) j
{ j
t=b[i];
b[i]=b[post];
b[post]=t;
}
}
return 0;
15、 }
16、 耶稣有13个门徒,其中有一个就是出卖耶稣的叛徒,请用排除法找出这位叛徒:13人围坐一圈,从第一个开始报号:1,2,3,1,2,3……,凡是报到“3”就退出圈子,最后留在圈内的人就是出卖耶稣的叛徒,请找出它原来的序号。
/*
// approach one
#define N 13
#include
#include
struct person
{
int number; //its order in the original circle
int nextp; //record its next person
};
struct person link[N+1]; //link[0] for no use
void main()
{
int i,count,next; //count for 12 persons,and
//next for the person not out of circle yet
clrscr();
for (i=1;i<=N;i++)
{
link[i].number=i; //numbering each person
if(i==N)
link[i].nextp=1;
else
link[i].nextp=i+1; //numbering each next person
}
printf("\nThe sequence out of the circle is:\n");
for(next=1,count=1;count
#include
#include
#include
// struct person //permit struct placed here//
// {
// int number;
// struct person *next;
// };
void main()
{
int i,count;
struct person //or permit struct placed here also//
{
int number;
struct person *next;
};
struct person *head,*p1,*p2;
clrscr();
head=p2=NULL;
for(i=1;i<=N;i++)
{
p1=(struct person *)malloc(LEN);
p1->number=i;
if(head==NULL)
head=p1;
else
p2->next=p1;
p2=p1;
}
p2->next=head;
printf("\nthe sequence out of the circle is:\n");
for (count=1;countnext;
i++;
}
p2=head;
printf("%3d ",p2->number);
p1->next=head=p2->next;
free(p2);
}
printf("\nThe betrayer of them is:\n%3d",head->number);
getch();
}
15、按如下图形打印杨辉三角形的前10行。其特点是两个腰上的数都为1,其它位置上的每一个数是它上一行相邻两个整数之和。
1
2 1
2 2 1
2 3 3 1
2 4 6 4 1
……
#include
#include
#define N 10
void main()
{
int i,j,k,a[N][N];
clrscr();
for(i=0;i
#include
/*disp student info*/
void DispScore(char num[][6],char name[][20],float score[][CNUM])
{
int i,j;
printf("\n\nStudent Info and Score:\n");
for(i=0;i=2)
{
printf("%s ",num[i]);
for(j=0;j=85&&score[i][j]<=90)
n++;
if(n==3)
printf("%s %s\n",num[i],name[i]);
}
}
/*input student info*/
void main()
{
char num[SNUM][6],name[SNUM][20]; //array num refers to student number
float score[SNUM][CNUM]; //and its length is 6
int i,j;
clrscr();
printf("\nPlease input student num and score:\n");
for(i=0;i
#include
double fact(double x,int y)
{
if(y==1)
return x;
else
return x*fact(x,y-1);
}
void main()
{
double x;
int y;
clrscr();
printf("\nPlease x,y:");
scanf("%lf%d",&x,&y);
printf("\nx^y=%.2lf",fact(x,y));
getch();
}
18、打印魔方阵。
所谓魔方阵是指这样的的方阵:
它的每一行、每一列和对角线之和均相等。
输入n,要求打印由自然数1到n2的自然数构成的魔方阵(n为奇数)。
例如,当n=3时,魔方阵为:
8 1 6
3 5 7
4 9 2
魔方阵中各数排列规律为:
① 将“1”放在第一行的中间一列;
② 从“2”开始直到n×n为止的各数依次按下列规则存放:每一个数存放的行比前一个数的行数减1,列数同样加1;
③ 如果上一数的行数为1,则下一个数的行数为n(最下一行),如在3×3 方阵中,1在第1行,则2应放在第3行第3列。
④ 当上一个数的列数为n时,下一个数的列数应为1,行数减1。如2在第3行第3列,3应在第2行第1列。
⑤如果按上面规则确定的位置上已有数,或上一个数是第1行第n列时,则把下一个数放在上一个数的下面。如按上面的规定,4应放在第1行第2列,但该位置已被1占据,所以4就放在3的下面。由于6是第1行第3列(即最后一列),故7放在6下面。
#include
#include
#define Max 15
void main()
{
int i,row,col,odd;
int m[Max][Max];
clrscr();
printf("\nPlease input an odd:");
scanf("%d",&odd);
if(odd<=0||odd%2==0)
{
printf("\nInput Error!\n");
getch();
return 0;
}
printf("\nodd=%d\n\n",odd);
row=0;
col=odd/2; //1 placed in the middle of the first row
for(i=1;i<=odd*odd;i++)
{
m[row][col]=i;
if(i%odd==0) //to the last col
if(row==odd-1) //to the last row
row=0;
else
row++;
else //outmost else
{
if(row==0)
row=odd-1;
else
row--;
if(col==odd-1)
col=0;
else
col++;
} //end of outmost else
} //end of for
for(row=0;row
#include
void main( )
{
int a[N][M]; //int a[][]; not allowed here
int i,j,k,row,col,n,m,find=0;
clrscr();
printf("\nEnter n & m:\n\n");
scanf("%d%d",&n,&m);
printf("\nEnter a[0][0]--a[%d][%d]\n\n",n-1,m-1);
for(i=0;ia[k][col]) //find row,select sort according to row
row=k;
if(i==row)
{
find=1;
printf("The point is a[%d][%d].\n",row,col);
}
}
if(!find)
printf("\nNo solution.\n");
getch();
}
20、马克思在《数学手稿》中提出如下问题:有30个人(包括男人、女人和小孩)在一家饭店吃饭共花50先令,其中每个男人花3先令,每个女人花2先令, 每个小孩花1先令,问男人、女人、小孩各有多少人?
#include
#include
void main()
{
int man,woman,child,money=50,count=30;
int i,j,k;
clrscr();
printf("