diff --git a/4078_3people/Readme.md b/4078_3people/Readme.md new file mode 100644 index 0000000..b4f8d75 --- /dev/null +++ b/4078_3people/Readme.md @@ -0,0 +1,3 @@ +# + +* \ No newline at end of file diff --git a/4078_3people/doc/3人聚集.pdf b/4078_3people/doc/3人聚集.pdf new file mode 100644 index 0000000..d662553 Binary files /dev/null and b/4078_3people/doc/3人聚集.pdf differ diff --git a/4078_3people/doc/Readme.md b/4078_3people/doc/Readme.md new file mode 100644 index 0000000..b4f8d75 --- /dev/null +++ b/4078_3people/doc/Readme.md @@ -0,0 +1,3 @@ +# + +* \ No newline at end of file diff --git a/4078_3people/main.cpp b/4078_3people/main.cpp new file mode 100644 index 0000000..f39ad54 --- /dev/null +++ b/4078_3people/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() +{ + std::cout << "Hello Easy C++ project!" << std::endl; +} diff --git a/4078_3people/main.exe b/4078_3people/main.exe new file mode 100644 index 0000000..fc4df42 Binary files /dev/null and b/4078_3people/main.exe differ diff --git a/4078_3people/test/In1 (16).txt b/4078_3people/test/In1 (16).txt new file mode 100644 index 0000000..a0f65ea --- /dev/null +++ b/4078_3people/test/In1 (16).txt @@ -0,0 +1 @@ +7 8 9 diff --git a/4078_3people/test/In2 (8).txt b/4078_3people/test/In2 (8).txt new file mode 100644 index 0000000..b98e08c --- /dev/null +++ b/4078_3people/test/In2 (8).txt @@ -0,0 +1 @@ +5 6 10 diff --git a/4078_3people/test/in.txt b/4078_3people/test/in.txt new file mode 100644 index 0000000..2bfc22d --- /dev/null +++ b/4078_3people/test/in.txt @@ -0,0 +1 @@ +4 7 9 \ No newline at end of file diff --git a/4078_3people/test/in2.txt b/4078_3people/test/in2.txt new file mode 100644 index 0000000..ba56147 --- /dev/null +++ b/4078_3people/test/in2.txt @@ -0,0 +1 @@ +4 6 9 \ No newline at end of file diff --git a/4078_3people/test/out.txt b/4078_3people/test/out.txt new file mode 100644 index 0000000..e2d8e7e --- /dev/null +++ b/4078_3people/test/out.txt @@ -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 + diff --git a/4078_3people/threepeople.cpp b/4078_3people/threepeople.cpp new file mode 100644 index 0000000..8e4a4f1 --- /dev/null +++ b/4078_3people/threepeople.cpp @@ -0,0 +1,37 @@ +#include +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; +} \ No newline at end of file diff --git a/4078_3people/threepeople.exe b/4078_3people/threepeople.exe new file mode 100644 index 0000000..8239917 Binary files /dev/null and b/4078_3people/threepeople.exe differ