結果
| 問題 |
No.163 cAPSlOCK
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-30 12:46:06 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,463 bytes |
| コンパイル時間 | 813 ms |
| コンパイル使用メモリ | 109,300 KB |
| 実行使用メモリ | 27,448 KB |
| 最終ジャッジ日時 | 2024-09-21 00:49:32 |
| 合計ジャッジ時間 | 2,466 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | WA * 6 RE * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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]);
}
}
}
}