結果
問題 | No.163 cAPSlOCK |
ユーザー |
![]() |
提出日時 | 2023-05-29 13:17:02 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 29,568 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-28 09:48:55 |
合計ジャッジ時間 | 1,242 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <stdio.h> #include <malloc.h> #include <ctype.h> char str[60000]; int str_len = 0; /// <summary> /// グローバル変数strの中身を入力された文字列で上書きする /// </summary> void ReadString() { char c = getchar(); str_len = 0; while (c != '\n') { str[str_len] = c; c = getchar(); str_len++; } } char Reverse(char c) { if (isdigit(c)) { return c; } else { if (c >= 'a' && c <= 'z') { return c - 32; } else { return c + 32; } } } int main() { ReadString(); for (int i = 0;i < str_len;i++) { printf("%c", Reverse(str[i])); } }