1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;

class Program {
    static void Main(string[] args) {
        Console.WriteLine(
            DateEx(Console.ReadLine(), long.Parse(Console.ReadLine()))
            );
        
        Console.WriteLine(
            DateEx(long.Parse(Console.ReadLine()))
            );
        
        Console.ReadLine();
    }

    static string DateEx(string date, long addSeconds) {
        DateTime d;
        DateTime.TryParse(date, out d);
        if(d == null) throw new ArgumentException("日付が正しくありません。", "date");
        return d.AddSeconds((double)addSeconds).ToString();
    }

    static string DateEx(long addSeconds) {
        return DateEx(DateTime.Now.ToString(), addSeconds);
    }
}