結果

問題 No.163 cAPSlOCK
ユーザー つなぎ
提出日時 2017-02-20 16:09:17
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 241 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 20,992 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 06:19:07
合計ジャッジ時間 1,146 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[100]’ [-Wformat=]
    7 |   scanf("%s",&aa);
      |          ~^  ~~~
      |           |  |
      |           |  char (*)[100]
      |           char *
main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   scanf("%s",&aa);
      |   ^~~~~~~~~~~~~~~

ソースコード

diff #

#include "stdio.h"
#include "string.h"

int main(void) {
  char aa[100];
  int i=0;
  scanf("%s",&aa);

  for(i=0;i<strlen(aa);i++){
    if(aa[i]<'a')aa[i]+='a'-'A';
    else if(aa[i]>'Z')aa[i]-='a'-'A';
  }
  printf("%s",aa);

  return 0;
}
0