結果

問題 No.18 うーさー暗号
ユーザー satanic
提出日時 2015-11-23 04:05:43
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-13 17:12:26
合計ジャッジ時間 867 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%s", S);
      |   ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void loopAlpha(char* c){
  while(*c<'A')*c+=26;
}

int main(){
  char c, S[1024]={'\0'};
  int i;

  scanf("%s", S);
  for(i=0; i<1024 && S[i]!='\0'; ++i){
    c=S[i];
    c-=i+1;
    loopAlpha(&c);
    S[i]=c;
  }

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

  return 0;
}
0