結果
問題 |
No.69 文字を自由に並び替え
|
ユーザー |
![]() |
提出日時 | 2016-05-12 21:34:50 |
言語 | C90 (gcc 12.3.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 541 bytes |
コンパイル時間 | 397 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 06:14:36 |
合計ジャッジ時間 | 1,473 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 RE * 2 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:9:19: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] 9 | int len = strlen(a); | ^~~~~~ main.c:2:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’ 1 | #include <stdio.h> +++ |+#include <string.h> 2 | main.c:9:19: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch] 9 | int len = strlen(a); | ^~~~~~ main.c:9:19: note: include ‘<string.h>’ or provide a declaration of ‘strlen’ main.c:29:12: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration] 29 | if(strcmp(a, b) == 0){ | ^~~~~~ main.c:29:12: note: include ‘<string.h>’ or provide a declaration of ‘strcmp’ main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s%s", a, b); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ char a[10]; char b[10]; char temp; int i, j; scanf("%s%s", a, b); int len = strlen(a); for(i = 0; i < len - 1; i++){ for(j = 0; j < len - 1 - i; j++){ if(a[j] > a[j + 1]){ temp = a[j]; a[j] = a[j + 1]; a[j + 1] = temp; } } } for(i = 0; i < len - 1; i++){ for(j = 0; j < len - 1 - i; j++){ if(b[j] > b[j + 1]){ temp = b[j]; b[j] = b[j + 1]; b[j + 1] = temp; } } } if(strcmp(a, b) == 0){ printf("YES\n"); }else{ printf("NO\n"); } return 0; }