C 练习实例78
C 语言教程
· 2019-02-22 13:27:19
题目:找到年龄最大的人,并输出。请找出程序中有什么问题。
程序分析:无。
实例
// Created by www.codercto.com on 15/11/9.
// Copyright © 2015年 码农教程. All rights reserved.
//
#include<stdio.h>
#include<stdlib.h>
struct man{
char name[20];
int age;
}
person[3]={"li",18,"wang",25,"sun",22};
int main()
{
struct man *q,*p;
int i,m=0;
p=person;
for(i=0;i<3;i++)
{
if(m<p->age)
{
m=p->age;
q=p;
}
p++;
}
printf("%s %d\n",q->name,q->age);
return 0;
}
以上实例运行输出结果为:
wang 25
点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html
Rapid Web Applications with TurboGears
Mark Ramm、Kevin Dangoor、Gigi Sayfan / Prentice Hall PTR / 2006-11-07 / USD 44.99
"Dear PHP, It's over between us. You can keep the kitchen sink, but I want my MVC. With TurboGears, I was able to shed the most heinous FileMaker Pro legacy 'solu-tion' imaginable. It has relationshi......一起来看看 《Rapid Web Applications with TurboGears》 这本书的介绍吧!