結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
Hissha_
|
| 提出日時 | 2018-04-02 10:22:07 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 486 bytes |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 29,568 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 13:57:10 |
| 合計ジャッジ時間 | 726 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 1 |
コンパイルメッセージ
main.c: In function 'main':
main.c:13:24: warning: comparison between pointer and integer
13 | if(a[i]==NULL){
| ^~
ソースコード
#include <stdio.h>
int main(void) {
// your code goes here
char a[10], b[10];
char c;
int i, j, n, counta=0, countb=0;
scanf("%s", a);
scanf("%s", b);
for(i=0;i<11;i++){
if(a[i]==NULL){
n=i;
break;
}
}
for(i=0;i<n;i++){
c=a[i];
for(j=0;j<n;j++){
if(a[j]==c) counta++;
}
for(j=0;j<n;j++){
if(b[j]==c) countb++;
}
if(counta!=countb){
printf("%s\n","NO");
return 0;
}
counta=0;
countb=0;
}
printf("%s\n","YES");
return 0;
}
Hissha_