3人聚集
This commit is contained in:
parent
133256e900
commit
7abbe7cd66
|
@ -0,0 +1,3 @@
|
|||
# 标题
|
||||
|
||||
* 内容
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
# 标题
|
||||
|
||||
* 内容
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello Easy C++ project!" << std::endl;
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
7 8 9
|
|
@ -0,0 +1 @@
|
|||
5 6 10
|
|
@ -0,0 +1 @@
|
|||
4 7 9
|
|
@ -0,0 +1 @@
|
|||
4 6 9
|
|
@ -0,0 +1,28 @@
|
|||
## z:\Chao\src\4078_3people\test\in.txt
|
||||
2020/04/06 ÖÜÒ» 9:14:16.40
|
||||
1
|
||||
2
|
||||
-----------------------------------------------
|
||||
Process exited after 150 ms with return value 0
|
||||
|
||||
## z:\Chao\src\4078_3people\test\In1 (16).txt
|
||||
2020/04/06 ÖÜÒ» 9:14:16.40
|
||||
0
|
||||
0
|
||||
-----------------------------------------------
|
||||
Process exited after 100 ms with return value 0
|
||||
|
||||
## z:\Chao\src\4078_3people\test\In2 (8).txt
|
||||
2020/04/06 ÖÜÒ» 9:14:16.40
|
||||
2
|
||||
3
|
||||
-----------------------------------------------
|
||||
Process exited after 80 ms with return value 0
|
||||
|
||||
## z:\Chao\src\4078_3people\test\in2.txt
|
||||
2020/04/06 ÖÜÒ» 9:14:16.40
|
||||
1
|
||||
2
|
||||
-----------------------------------------------
|
||||
Process exited after 90 ms with return value 0
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
#include <iostream>
|
||||
using namespace std;
|
||||
int pan(int a, int b)
|
||||
{
|
||||
return a > b ? a : b;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int a, b, c;
|
||||
cin >> a >> b >> c;
|
||||
if (a > b) {
|
||||
int u = a;
|
||||
a = b;
|
||||
b = u;
|
||||
}
|
||||
if (a > c) {
|
||||
int u = a;
|
||||
a = c;
|
||||
c = u;
|
||||
}
|
||||
if (b > c) {
|
||||
int u = c;
|
||||
c = b;
|
||||
b = u;
|
||||
}
|
||||
if (a + 1 == b && b + 1 == c) {
|
||||
cout << "0" << endl
|
||||
<< "0";
|
||||
return 0;
|
||||
}
|
||||
if (a + 2 == b || b + 2 == c) {
|
||||
cout << "1" << endl;
|
||||
} else {
|
||||
cout << "2" << endl;
|
||||
}
|
||||
cout << pan(b - a, c - b)-1;
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue