Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
99500 李大川LDC 单词排序 C++ 解答错误 0 0 MS 268 KB 439 2023-08-22 22:05:32

Tests(0/5):


#include <iostream> #include <string> #include <algorithm> using namespace std; bool cmp(string x,string y) { return x<y; } string a[105]; int main() { string s; getline(cin,s); int b=0; int x=0; for(int i=0;i<s.size();i++) { if(s[i]==','||s[i]==' '||s[i]=='.'||s[i]=='!') { a[b++]=s.substr(x,i-x); x=i+1; } } sort(a,a+b,cmp); for(int i=0;i<b;i++) { cout<<a[i]<<"\n"; } return 0; }


测评信息:

输入

hi,I am Jack!

输出

I
Jack
am
hi

答案

4
I
Jack
am
hi

系统信息

exit code: 0, checker exit code: 0

输入

hello,My name is jack.

输出

My
hello
is
jack
name

答案

5
My
hello
is
jack
name

系统信息

exit code: 0, checker exit code: 0

输入

The first step is as good as half over.

输出

The
as
as
first
good
half
is
over
step

答案

9
The
as
as
first
good
half
is
over
step

系统信息

exit code: 0, checker exit code: 0

输入

Do one thing at a time,and do well.

输出

Do
a
and
at
do
one
thing
time
well

答案

9
Do
a
and
at
do
one
thing
time
well

系统信息

exit code: 0, checker exit code: 0

输入

Knowlegde can change your fate and English can accomplish your future.

输出

English
Knowlegde
accomplish
and
can
can
change
fate
future
your
your

答案

11
English
Knowlegde
accomplish
and
can
can
change
fate
future
your
your

系统信息

exit code: 0, checker exit code: 0