結果
問題 |
No.8042 本棚
|
ユーザー |
|
提出日時 | 2019-03-18 07:51:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 120 bytes |
コンパイル時間 | 1,190 ms |
コンパイル使用メモリ | 97,916 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 01:32:32 |
合計ジャッジ時間 | 1,716 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] 1 | #import<regex> | ^~~~~~ main.cpp:2:34: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 2 | std::string s[51];char t[50],i,j;main(){for(;gets(t);)s[i++]=t;for(sort(s,s+i);++j<i;)puts(s[j].data());} | ^~~~ main.cpp: In function ‘int main()’: main.cpp:2:50: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations] 2 | std::string s[51];char t[50],i,j;main(){for(;gets(t);)s[i++]=t;for(sort(s,s+i);++j<i;)puts(s[j].data());} | ~~~~^~~ In file included from /usr/include/stdio.h:894, from /usr/include/c++/11/cstdio:42, from /usr/include/c++/11/ext/string_conversions.h:43, from /usr/include/c++/11/bits/basic_string.h:6608, from /usr/include/c++/11/string:55, from /usr/include/c++/11/bitset:47, from /usr/include/c++/11/regex:39, from main.cpp:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:240:1: note: declared here 240 | gets (char *__str) | ^~~~ /usr/bin/ld: /tmp/ccEuaHjb.o: in function `main': main.cpp:(.text.startup+0x60): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#import<regex> std::string s[51];char t[50],i,j;main(){for(;gets(t);)s[i++]=t;for(sort(s,s+i);++j<i;)puts(s[j].data());}