跳到正文

题解

三角形

pop_l约 1 分钟
原文
文章信息与版本

文章信息

发布
2024年11月25日
收录
2025年12月12日
更新
2026年11月16日
篇幅
约 1 分钟

版本

  1. v1当前

“两边之和大于第三边”是三角形的一个基本性质,有了这个,我们就可以作出这道题。

C++
#include <bits/stdc++.h>
using namespace std;
int main(){
	int x,y;
	cin>>x>>y;
	cout<<y-x+1<<" ";//y为长边 
	cout<<x+y-1;//x,y均为短边 
	return 0; 
}
原文