会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
学习日志
博客园
首页
新随笔
联系
管理
时间计算
using
System;
namespace
reme
{
class
Program
{
static
void
Main(
string
[] args)
{
outPut();
Exit();
}
public
static
void
outPut()
{
DateTime d1
=
new
DateTime(
2004
,
10
,
2
);
DateTime d2
=
new
DateTime(
2007
,
3
,
4
);
TimeSpan d3
=
d2.Subtract(d1);
Console.Write(
"
天数:
"
+
d3.Days.ToString()
+
'
\n
'
);
Console.Write(
"
小时:
"
+
(d3.Days
*
24
).ToString()
+
'
\n
'
);
Console.Write(
"
分钟:
"
+
(d3.Days
*
24
*
60
).ToString()
+
'
\n
'
);
Console.Write(
"
秒 :
"
+
(d3.Days
*
24
*
60
*
60
).ToString()
+
'
\n
'
);
Console.Write(
'
\n
'
);
}
public
static
void
Exit()
{
Console.WriteLine(
"
按\
"
1
\
"
退出!\n
"
);
int
a
=
Console.Read();
while
(a
!=
1
)
{
Console.WriteLine(
"
按\
"
1
\
"
退出!\n
"
);
Console.Read();
}
}
}
}
结果:
仅以此纪念我的爱情!
posted on
2007-04-11 21:59
石川
阅读(
421
) 评论(
0
)
收藏
举报
刷新页面
返回顶部