結果

問題 No.163 cAPSlOCK
ユーザー fujitafujita
提出日時 2023-04-24 16:37:25
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 314 ms / 5,000 ms
コード長 846 bytes
コンパイル時間 9,232 ms
コンパイル使用メモリ 166,764 KB
実行使用メモリ 184,672 KB
最終ジャッジ日時 2024-04-26 04:58:52
合計ジャッジ時間 17,576 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 310 ms
30,656 KB
testcase_01 AC 313 ms
30,800 KB
testcase_02 AC 311 ms
30,672 KB
testcase_03 AC 312 ms
30,432 KB
testcase_04 AC 311 ms
30,564 KB
testcase_05 AC 312 ms
30,564 KB
testcase_06 AC 312 ms
30,328 KB
testcase_07 AC 312 ms
30,560 KB
testcase_08 AC 312 ms
30,760 KB
testcase_09 AC 312 ms
30,428 KB
testcase_10 AC 311 ms
30,712 KB
testcase_11 AC 310 ms
30,812 KB
testcase_12 AC 312 ms
30,556 KB
testcase_13 AC 314 ms
31,212 KB
testcase_14 AC 311 ms
30,560 KB
testcase_15 AC 313 ms
30,832 KB
testcase_16 AC 313 ms
30,304 KB
testcase_17 AC 311 ms
30,556 KB
testcase_18 AC 311 ms
30,300 KB
testcase_19 AC 311 ms
30,556 KB
testcase_20 AC 312 ms
30,688 KB
testcase_21 AC 309 ms
30,724 KB
testcase_22 AC 312 ms
184,672 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (97 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.cs(10,20): warning CS0168: 変数 'str' は宣言されていますが、使用されていません [/home/judge/data/code/main.csproj]
/home/judge/data/code/Main.cs(10,25): warning CS0168: 変数 'str2' は宣言されていますが、使用されていません [/home/judge/data/code/main.csproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
namespace yukicoder
{
    class Program
    {

        static void Main(string[] args)
        {
            var S = Console.ReadLine();
            string str, str2;
            var x = S.Split();
            string[] z = new string[S.Length];
            //文字分割
            for (int j = 0; j < S.Length; j++)
            {
                z[j] = x[0].Substring(j, 1);
            }
            
            for (int i = 0; i < S.Length; i++)
            {
                string upper = z[i].ToUpper();
                string lower = z[i].ToLower();
                if (z[i].Equals(upper))
                {
                    Console.Write(lower);
                }
                else if (z[i].Equals(lower))
                {
                    Console.Write(upper);
                }
            }
        }
    }
}
0