安全问答

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

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

c++代码改错:这段代码是第一行输入一个数字n第二行输入n个数字。输出n个数字中的最小值。请你把这段代码修改正确。输入 第一行输入一个数字n第二行输入n个数字。输出 n个数字中的最小值。输入样例 53 4 5 2 3输出样例 2用时内存 1000MS100MB提示 检查程序初始化是否正确。#include iostreamusing namespace std;int main int n

  • 日期: 2028-05-16
  • 标签: 社会

#include using namespace std;

int main() { int n, minn = INT_MAX, a[100]; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; }

for (int i = 0; i < n; i++)
{
    if (a[i] < minn)
    {
        minn = a[i];
    }
}
cout << minn;
return 0;

}

c++代码改错:这段代码是第一行输入一个数字n第二行输入n个数字。输出n个数字中的最小值。请你把这段代码修改正确。输入 第一行输入一个数字n第二行输入n个数字。输出 n个数字中的最小值。输入样例 53 4 5 2 3输出样例 2用时内存 1000MS100MB提示 检查程序初始化是否正确。#include iostreamusing namespace std;int main int n

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

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

  • 上一篇: Im using the Location service from Angular but on certain pages its page method returns an empty string which is different from windowlocationpathname Why
  • 下一篇: mysql存储过程创建一张新表

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