結果

問題 No.69 文字を自由に並び替え
ユーザー Haijinn
提出日時 2016-11-26 22:19:42
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 20,992 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 06:25:55
合計ジャッジ時間 735 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:13:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 | scanf("%s%s",a,b);
      | ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<string.h>
#include<stdio.h>

int main(){
	int i;
	int w=0;
	int q;
	int s;
	char a[100];
	char b[100];
	char x;
	
scanf("%s%s",a,b);
q=strlen(a);
for(i=0;i<q;i++){
	for(s=0;s<q;s++)if(b[s]==a[i]) {b[s]=0;break;}
		if(s==q)break;
}
	
	if(i==q){
		printf(i==q?"YES\n":"NO");
	}else{
		printf("NO\n");
	}
	
	
	
	return 0;
}
0