排版
This commit is contained in:
parent
4dc41586f5
commit
4711b88b92
3
4061_clear/Readme.md
Normal file
3
4061_clear/Readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
24
4061_clear/clear.cpp
Normal file
24
4061_clear/clear.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int n, k, now = 0;
|
||||
string a[101];
|
||||
cin >> n >> k;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a[i];
|
||||
}
|
||||
for (int i = 1; i <= n; i++) {
|
||||
if (now + a[i].size() <= k) {
|
||||
if (now > 0) {
|
||||
cout << " ";
|
||||
}
|
||||
} else {
|
||||
cout << endl;
|
||||
now = 0;
|
||||
}
|
||||
cout << a[i];
|
||||
now += a[i].size();
|
||||
}
|
||||
}
|
BIN
4061_clear/clear.exe
Normal file
BIN
4061_clear/clear.exe
Normal file
Binary file not shown.
3
4061_clear/doc/Readme.md
Normal file
3
4061_clear/doc/Readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
BIN
4061_clear/doc/排版.pdf
Normal file
BIN
4061_clear/doc/排版.pdf
Normal file
Binary file not shown.
6
4061_clear/main.cpp
Normal file
6
4061_clear/main.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello Easy C++ project!" << std::endl;
|
||||
}
|
BIN
4061_clear/main.exe
Normal file
BIN
4061_clear/main.exe
Normal file
Binary file not shown.
2
4061_clear/test/in.txt
Normal file
2
4061_clear/test/in.txt
Normal file
@ -0,0 +1,2 @@
|
||||
10 7
|
||||
hetto my nnne is ccssie and this is my essee
|
11
4061_clear/test/out.txt
Normal file
11
4061_clear/test/out.txt
Normal file
@ -0,0 +1,11 @@
|
||||
## z:\Chao\src\4061_clear\test\in.txt
|
||||
2020/03/28 ÖÜÁù 8:56:49.28
|
||||
hetto my
|
||||
nnne is
|
||||
ccssie
|
||||
and this
|
||||
is my
|
||||
essee
|
||||
-----------------------------------------------
|
||||
Process exited after 180 ms with return value 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user