結果
| 問題 | No.69 文字を自由に並び替え | 
| コンテスト | |
| ユーザー |  sk3388607083 | 
| 提出日時 | 2018-06-21 18:15:08 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 502 bytes | 
| コンパイル時間 | 179 ms | 
| コンパイル使用メモリ | 23,680 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-14 07:05:19 | 
| 合計ジャッジ時間 | 833 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 14 WA * 1 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |   scanf("%s", A);
      |   ~~~~~^~~~~~~~~
main.cpp:22:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |   scanf("%s", B);
      |   ~~~~~^~~~~~~~~
            
            ソースコード
#include<stdio.h>
#include<string.h>
void sort(char *a, int size){
  int i, j;
  char tmp;
  for(i = 0 ; i < size-1; i++){
    for(j = size-1; j > i; j--){
      if(a[j-1] > a[j]){
	tmp = a[j-1];
	a[j-1] = a[j];
	a[j] = tmp;
      }
    }
  }
}
int main(void){
  int i;
  char A[10], B[10];
  scanf("%s", A);
  scanf("%s", B);
  i = 0;
  while(A[i] != '\0') i++;
  sort(A, i);
  i = 0;
  while(B[i] != '\0') i++;
  sort(B, i);
  if(strcmp(A, B)) printf("NO\n");
  else printf("YES\n");
  return 0;
}
            
            
            
        