安全问答

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

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

题目描述:输入:n + 1行第一行输入一个数n随后n行每一行有x、y两数代表答案z除x余y输出:答案z的最小值用C++解答

  • 日期: 2027-04-28
  • 标签: 社会
#include <iostream>
#include <climits>

int main() {
    int n;
    std::cin >> n;

    int min_z = INT_MAX;

    for (int i = 0; i < n; i++) {
        int x, y;
        std::cin >> x >> y;
        int z = x % y;
        if (z < min_z) {
            min_z = z;
        }
    }

    std::cout << min_z << std::endl;

    return 0;
}
题目描述:输入:n + 1行第一行输入一个数n随后n行每一行有x、y两数代表答案z除x余y输出:答案z的最小值用C++解答

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

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

  • 上一篇: 以医务检定员助理的身份写一篇实习日报第三天包含在以医务检定员助理实习过程中遇到的有机化学专业知识包括:实习过程及内容记录典型生产案例记录及分析存在问题、启示。
  • 下一篇: 帮我润色一下以下英文2 For the proposed two defensive algorithms there is no theoretical verification about security or privacy so the effectiveness of the proposed defense mechanisms is difficult to be verified

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