安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

输出 n个整数中的最小值输入输入 第一行输入一个正整数n1=n=100 接下来输入n个数数的范围 -100到100之间 输出输出这n个数中的最小值 复制样例输入36 89 -1复制样例输出-1 c++

  • 日期: 2024-10-31
  • 标签: 社会
#include <iostream>
#include <climits>
using namespace std;

int main() {
    int n;
    cin >> n;
    int minNum = INT_MAX;
    
    for (int i = 0; i < n; i++) {
        int num;
        cin >> num;
        if (num < minNum) {
            minNum = num;
        }
    }
    
    cout << minNum << endl;
    
    return 0;
}
输出 n个整数中的最小值输入输入 第一行输入一个正整数n1=n=100 接下来输入n个数数的范围 -100到100之间 输出输出这n个数中的最小值 复制样例输入36 89 -1复制样例输出-1 c++

原文地址: https://www.cveoy.top/t/topic/h6T0 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: function registerAction 1、获取表单数据 var data = $#regiterFormserializeArray; 2、发起异步请求 请求地址数据响应方式类型 $getGramosProjectmembregisterdatafunction result consolelog
  • 下一篇: An era without Dennard scaling along with reduced Moores Law and Amdahls Law in full effect means inefficiency limits improvement in performance to only a few percent per year Achievinghigher rates of

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2