結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-09-27 14:28:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 5,000 ms |
| コード長 | 818 bytes |
| コンパイル時間 | 4,285 ms |
| コンパイル使用メモリ | 108,356 KB |
| 実行使用メモリ | 25,420 KB |
| 最終ジャッジ日時 | 2024-07-20 08:32:19 |
| 合計ジャッジ時間 | 5,311 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
namespace PracticeAtCoder
{
class Program
{
static void Main(string[] args)
{
//018うーさー暗号
//入力
string sA = Console.ReadLine();
//int[] after = t.Select(s => int.Parse(s)).ToArray();
char[] chaA = sA.ToCharArray();
int x = 0;
int chY = 0;
foreach(char chaB in chaA){
// 65:A 90:Z
x++;
x= x%26;
chY = (int)chaB;
if(chY - x <65){
chY = chaB +26;
}
chY = chY - x;
Console.Write((char)chY); // 出力:97
}
/*
char c1 = 'a';
int code1 = (int)c1;
Console.WriteLine(code1); // 出力:97
int code3 = 99;
char c3 = (char)code3;
Console.WriteLine(c3); // 出力:c
*/
}
}
}