This commit is contained in:
parent
4dc41586f5
commit
4711b88b92
|
@ -0,0 +1,3 @@
|
|||
# 标题
|
||||
|
||||
* 内容
|
|
@ -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();
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
# 标题
|
||||
|
||||
* 内容
|
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello Easy C++ project!" << std::endl;
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,2 @@
|
|||
10 7
|
||||
hetto my nnne is ccssie and this is my essee
|
|
@ -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…
Reference in New Issue