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

查看所有标签

Computer Age Statistical Inference

Computer Age Statistical Inference

Bradley Efron、Trevor Hastie / Cambridge University Press / 2016-7-21 / USD 74.99

The twenty-first century has seen a breathtaking expansion of statistical methodology, both in scope and in influence. 'Big data', 'data science', and 'machine learning' have become familiar terms in ......一起来看看 《Computer Age Statistical Inference》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器