結果
問題 |
No.69 文字を自由に並び替え
|
ユーザー |
|
提出日時 | 2018-07-28 09:37:22 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 489 bytes |
コンパイル時間 | 175 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 07:07:19 |
合計ジャッジ時間 | 896 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
コンパイルメッセージ
main.c: In function 'main': main.c:9:9: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 9 | gets(s[i]); | ^~~~ | fgets /usr/bin/ld: /tmp/ccVMnD8e.o: in function `main': main.c:(.text.startup+0x23): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char s[2][11],t; int i,j,k; for(i=0;i<2;i++){ gets(s[i]); for(j=0;j<strlen(s[i])-1;j++){ for(k=strlen(s[i])-1;k>j;k--){ if(s[i][k-1]>s[i][k]){ t=s[i][k-1]; s[i][k-1]=s[i][k]; s[i][k]=t; } } } } puts(strstr(s[0],s[1])!=NULL?"YES":"NO"); return 0; }