結果

問題 No.163 cAPSlOCK
ユーザー n.yn.y
提出日時 2022-05-30 12:46:06
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,463 bytes
コンパイル時間 1,948 ms
コンパイル使用メモリ 108,104 KB
実行使用メモリ 23,716 KB
最終ジャッジ日時 2023-10-21 00:19:23
合計ジャッジ時間 3,284 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 23 ms
23,688 KB
testcase_02 AC 23 ms
23,692 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Diagnostics;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //文字入力
            string S = Console.ReadLine();
            string[] s = new string[S.Length];
            //比較用配列
            string[] a = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
            //表示用
            string[] n = new string[S.Length];
            int[] v = new int[S.Length];

            //入力した文字列の一部分を取得
            for (int i=0;i<S.Length;i++)
            {
                string str = S.Substring(i, 1);
                s[i] = str;
            }
            //文字列の置き換え
            for (int i = 0; i < a.Length; i++)
            {
                    for (int k = 0; k < S.Length; k++)
                    {
                        if (s[k] == a[k])
                        {
                            string ans = s[k].ToUpper();
                            n[k] = ans;
                        }
                        else 
                        {
                            string ans = s[k].ToLower();
                            n[k] = ans;
                        }
                }

            }
            for(int i=0;i<S.Length;i++)
            {
                Console.Write(n[i]);

            }


        }
    }
}
0