結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-11 14:21:17 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,019 bytes |
| コンパイル時間 | 921 ms |
| コンパイル使用メモリ | 112,260 KB |
| 実行使用メモリ | 26,168 KB |
| 最終ジャッジ日時 | 2025-11-11 14:21:18 |
| 合計ジャッジ時間 | 1,590 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
public class Program
{
public static void Main()
{
int happyDay = 0; //カウント
for (int i = 0; i < 365; i++)
{
DateTime addDay = new DateTime(2015, 1, 1).AddDays(i);
if (addDay.Month == addDay.Day) //月と日が同じ
{
happyDay++;
//Console.WriteLine(addDay.ToString());
continue;
}
else if (addDay.Day >= 10) //day10以上
{
//十の位
int ten = int.Parse(addDay.Day.ToString().Substring(0,1));
//一の位
int one = int.Parse(addDay.Day.ToString().Substring(1));
int num = ten + one;
if (addDay.Month == num)
{
happyDay++;
//Console.WriteLine(addDay.ToString());
continue;
}
}
}
Console.WriteLine("{0}", happyDay);
}
}