当前位置:网站首页>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;
}
边栏推荐
- Flask introductory learning tutorial
- Visual Studio 集成Qt开发环境的一些注意事项
- 经典实例分割模型Mask RCNN原理与测试
- 如何快速拷贝整个网站所有网页
- tiup env
- AI遮天传 DL-CNN
- MySql 和 PostgreSQL 数据库 根据一张表update另一张表数据
- PCIE入门
- 【HMS core】【Media】【Video Editing Service】 The online material cannot be displayed, it is always in the loading state or the network is abnormal
- Shell脚本的概念
猜你喜欢
随机推荐
解析字符串拼接的两种情况
TiDB tool download
php how to query string occurrence position
tiup install
Applicable scenarios of TiDB tools
Shell脚本的概念
Qt 容器控件Tool Box 使用详解
完美绕开CRC32检测的无痕hook
大厂高管借钱炒股,亏到破产卖房。。。
【AGC】质量服务1-崩溃服务示例
Recent learning defragmentation (24)
数据库 - 创建数据库、表、函数等
武汉星起航跨境电商有前景吗?亚马逊的未来趋势如何发展?
Troubleshooting TiUP
三维重建方法汇总
hcip--ospf综合实验
LeetCode-283-移动零
Visual Studio 集成Qt开发环境的一些注意事项
【HMS core】【FAQ】push kit、分析服务、视频编辑服务典型问题合集3
Load Base Split usage documentation