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://www.codercto.com/courses/l/17.html

查看所有标签

Web Security, Privacy and Commerce, 2nd Edition

Web Security, Privacy and Commerce, 2nd Edition

Simson Garfinkel / O'Reilly Media / 2002-01-15 / USD 44.95

Since the first edition of this classic reference was published, World Wide Web use has exploded and e-commerce has become a daily part of business and personal life. As Web use has grown, so have ......一起来看看 《Web Security, Privacy and Commerce, 2nd Edition》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具

SHA 加密
SHA 加密

SHA 加密工具