結果

問題 No.69 文字を自由に並び替え
ユーザー A63295A63295
提出日時 2015-12-22 00:01:23
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 24,652 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 20:42:02
合計ジャッジ時間 1,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 RE -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main(void){
int a = 0, i = 0, j = 0, k = 0, l = 0, temp;
char A[10], B[10];
scanf ("%s%s", A, B);
printf ("%s%s",A, B);

while ( A[l] != '\0'){
	l++;
}

for (i = 0; i < l - 1; i++){
	for (j = i + 1; j < l; j++){
		if ( A[i] > A[j]){
			temp = A[i];
			A[i] = A[j];
			A[j] = temp;
		}
		
	}
}
for (i = 0; i < l - 1; i++){
	for (j = i + 1; j < l; j++){
		if ( B[i] > B[j]){
			temp = B[i];
			B[i] = B[j];
			B[j] = temp;
		}
	}
}
while (a < l){
	if(A[k] == B[k]){
	k++;
	}
a++;
}	

if ( k == l)
printf ("YES");
else
printf ("NO");
	return 0;
}
0