题目:找到年龄最大的人,并输出。请找出程序中有什么问题
题目:找到年龄最大的人,并输出。请找出程序中有什么问题
There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence.
The blog content is all parallel goods. Those who are worried about being cheated should leave quickly.
题目:找到年龄最大的人,并输出。请找出程序中有什么问题。
1.程序分析:
2.程序源代码:
#define N 4
#include "stdio.h"
static struct man
{ char name[20];
int age;
} person[N]={"li",18,"wang",19,"zhang",20,"sun",22};
main()
{struct man *q,*p;
int i,m=0;
p=person;
for (i=0;i<N;i++)
{if(m<p->age)
q=p++;
m=q->age;}
printf("%s,%d",(*q).name,(*q).age);
}
原文地址:https://blog.csdn.net/InJavaWeTrust/article/details/139190668
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!