if (DateTime.Now.ToString("MMdd") == "0101") { Console.WriteLine("Happy New Year"); } else { Console.WriteLine($"It\'s still {DateTime.Now.Year}..."); }
try {
(DateTime.Now.ToString("YYYYMMdd001").ToInt32 } catch(Exception e) {
Console.WriteLine("Happy New Year to Everyone and especially Microsoft as well as Honda devs"); } finally {
Console.WriteLine($"It\ presently is year {DateTime.Now.Year}."); }
正しい例 (スコア:0)
if (DateTime.Now.ToString("MMdd") == "0101")
{
Console.WriteLine("Happy New Year");
}
else
{
Console.WriteLine($"It\'s still {DateTime.Now.Year}...");
}
#異論は認める
Re: (スコア:1)
try
{
(DateTime.Now.ToString("YYYYMMdd001").ToInt32
}
catch(Exception e)
{
Console.WriteLine("Happy New Year to Everyone and especially Microsoft as well as Honda devs");
}
finally
{
Console.WriteLine($"It\ presently is year {DateTime.Now.Year}.");
}
Re: (スコア:1)
コンパイルが通りません。バグですか?
Re: (スコア:0)
コンパイルする系統の言語に見えません
Re:正しい例 (スコア:0)
コンパイルする系統の言語ですよ。