結果
| 問題 |
No.9000 Hello World! (テスト用)
|
| ユーザー |
くれちー
|
| 提出日時 | 2017-10-09 12:53:31 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 5,000 ms |
| コード長 | 1,049 bytes |
| コンパイル時間 | 1,211 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 17,280 KB |
| 最終ジャッジ日時 | 2024-12-25 15:05:25 |
| 合計ジャッジ時間 | 1,892 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class Hoge
{
private string _helloWorld;
private char _suffix = '!';
public string HelloWorld
{
get => _helloWorld;
set => _helloWorld = value ?? throw new ArgumentNullException();
}
public string TryGetHelloWorld(out string str)
=> str = (this.HelloWorld is string helloWorld) ? helloWorld : "";
public ref char GetSuffix() => ref _suffix;
}
class Program
{
public static void Main()
{
(string helloWorld, int, char suffix, double) HelloWorld()
{
var hoge = new Hoge() { HelloWorld = "Hello World" };
var suffix = hoge.GetSuffix();
switch (hoge)
{
case object hogeObj:
{
((Hoge)hogeObj).TryGetHelloWorld(out var helloWorld);
return (helloWorld, 114514, suffix, Math.PI);
}
}
throw new Exception();
}
var (h, _, s, _) = HelloWorld();
Console.WriteLine(h + s);
}
}
くれちー