当前位置: 首页 > news >正文

编程练习

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {int x1, y1, x2, y2;cin >> x1 >> y1 >> x2 >> y2; // 读取两个点的坐标 int dx = abs(x2 - x1);int dy = abs(y2 - y1);// 坐标差值    int manhattan = dx + dy;// 曼哈顿距离int chebyshev = max(dx, dy);// 切比雪夫距离cout << manhattan << " " << chebyshev << endl;return 0;
}
#include <iostream>
using namespace std;int main() {int total_minutes = 0;for (int i = 0; i < 3; i++) {//读取时间段int h1, m1, h2, m2;cin >> h1 >> m1 >> h2 >> m2;int start_m = h1 * 60 + m1;int end_m = h2 * 60 + m2;total_m += (end_m - start_m);}int hours = total_m / 60;int minutes = total_m% 60; // 转换成小时和分钟cout << hours << " " << minutes << endl;if (hours >= 4) {// 判断结果cout << "YES" << endl;} else {cout << "NO" << endl;}


 


}
#include <iostream>
using namespace std;
int main(){cout<<"Hello excellent athletes!"<<endl;cout<<"Hello excellent acmers!"<<endl;cout<<"Welcome to HZNU!"<<endl;return 0;
}

 

http://www.gsyq.cn/news/28791.html

相关文章:

  • Codeforces Round 976 (Div. 2) A. Find Minimum Operations
  • 20251021 NOIP模拟赛
  • RocketMQ+Spring Boot的简单实现及其深入分析
  • XSD 文档(XML Schema Definition)简介
  • LLM 场景下的强化学习技术扫盲
  • vmware虚拟机下载安装教程(付安装包)详细图文下载安装教程
  • deepin 25 虚拟机安装vgpu客户机驱动
  • CF2153D
  • 英语_阅读_inspiration for artists_待读
  • Node.js JSON import attributes All In One
  • DeepSeek的“认知提纯”能力解析
  • Plya 定理学习笔记 | ABC428G 题解
  • 告别繁琐排版!揭秘2025年公众号推文排版top1神器
  • leetcode1. 两数之和、15. 三数之和、18. 四数之和
  • vue3+elementPlus el-date-picker 自定义禁用状态hook 建立结束时间不能小于开始时间
  • 【做题记录】贪心--提高组
  • 【为美好CTF献上祝福】 New Star 2025 逆向笔记
  • XXL-JOB(5)
  • Ramanujan Master Theorem
  • 【周记】2025.10.13~2025.10.19
  • C++案例 自定义数组
  • 20251023周四日记
  • ord() 函数
  • Redis中的分布式锁之SETNX底层实现
  • 2025家纺摄影公司推荐,南通鼎尚摄影专注产品视觉呈现
  • 求函数
  • Python---简易编程解决工作问题
  • MPK(Mirage Persistent Kernel)源码笔记(1)--- 基础原理
  • 背包dp(1)
  • 比赛题解 总结