当前位置:网站首页>The case of five little pigs (five little pigs compare the size of the body weight)
The case of five little pigs (five little pigs compare the size of the body weight)
2022-07-30 16:04:00 【51CTO】
#include
using namespace std;
int main() {
int arr[5]= { 100,200,300,400,50 };
int max = 0;//First determine that the maximum value is 100 with subscript 0
for(int i = 0; i < 5; i++) {
if (arr[i] > max) {
//If the updated element is larger than the maximum value I think, update the maximum value
max = arr[i];
}
}
cout << "The maximum weight of the piglet is:" << max << endl;//It should be placed outside, because in the for loop, each assignment will be assignedprint out the number
system("pause");
return 0;
}
边栏推荐
猜你喜欢

PMP每日一练 | 考试不迷路-7.30(包含敏捷+多选)

rscsa笔记八

PCIE下载的驱动安装

yarn安装详细教程说明、升级教程、修改yarn的全局和缓存目录、yarn基本命令

arcpy使用教程
![[flutter]什么是MaterialApp和Material design](/img/72/d0845467b33b2291f47e7f54171088.jpg)
[flutter]什么是MaterialApp和Material design

Why is there no data reported when the application is connected to Huawei Analytics in the application debugging mode?

解析字符串拼接的两种情况

rhce笔记1

【HMS core】【FAQ】A collection of typical questions about Account, IAP, Location Kit and HarmonyOS 1
随机推荐
Sparse-PointNet: See Further in Autonomous Vehicles 论文笔记
涨姿势了!原来这才是多线程正确实现方式
【AGC】质量服务1-崩溃服务示例
LeetCode-283-移动零
Databases - create databases, tables, functions, etc.
谷歌工程师『代码补全』工具;『Transformers NLP』随书代码;FastAPI开发模板;PyTorch模型加速工具;前沿论文 | ShowMeAI资讯日报
加密生活,Web3 项目合伙人的一天
Xshell命令
Applicable scenarios of TiDB tools
Promise笔记(一)
tiup completion
go 学习03 基础知识变量类型
大厂高管借钱炒股,亏到破产卖房。。。
Data Analysis Tools - DDL operations & DML operations in HQL
Golang分布式应用之Redis怎么使用
影像信息提取DEM
Qt 容器控件之Tab Widget 使用详解
DTSE Tech Talk丨第2期:1小时深度解读SaaS应用系统设计
How to intercept the first few digits of a string in php
hcip--ospf综合实验