結果

問題 No.400 鏡
ユーザー exteloextelo
提出日時 2016-07-23 02:08:04
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 656 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 24,124 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-06 11:12:36
合計ジャッジ時間 1,078 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 0 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 0 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

void hanten(char str[], int i)
{
  int e,j;
  char c;
  e = i/2;
  i= i-1;

  
  for(j=0;j<e;j++){
    c = str[j];
    str[j] = str[i];
    str[i] = c;
    i--;
  }

}

void change(char str[])
{
  int i;

  for(i=0;i<20;i++){
    if(str[i] == '\0'){
      break;
    } else if(str[i] == '>'){
      str[i] = '<';
    } else if(str[i] == '<'){
      str[i] = '>';
    }
  }
}

int main(void)
{

  int i;
  char c, str[20];

  for(i=0;i<20;i++){
    scanf("%c", &c);
    if(c == '\n'){
      str[i] = '\0';
      break;
    }
    else {
      str[i] = c;
    }
  }

  hanten(str, i);
  change(str);

  printf("%s\n", str);

  return 0;
}
0