答案发到邮箱吧345927600@qq.com谢谢!
其中月份编号依次为: 0 3 3 6 1 4 6 2 5 0 3 5,修正数为:0,1,2,3,4,5,6
用汇编语言求给定一个日期求出这个日期是星期几(修正数法)
答案:2 悬赏:60 手机版
解决时间 2021-02-14 16:35
- 提问者网友:嗝是迷路的屁
- 2021-02-14 09:44
最佳答案
- 五星知识达人网友:你哪知我潦倒为你
- 2021-02-14 11:02
自己的小算盘。这是一个例子
包括
#包括
诠释GetWeekDay(nYear,诠释NMON,INT n天,INT * npWeekDay);
廉政的main()
{
诠释nMyWeekDay;
诠释nResult;
nResult = GetWeekDay(2007年,1,10,及nMyWeekDay);
返回0;
}
/ /输入日期,返回星期的C语言函数
诠释GetWeekDay(nYear,NMON,诠释nDay,诠释* npWeekDay)
{
诠释nRetVal = 0;
time_t的tMyDateTime;
结构TM tmMyDate,tmpMyDate;
>
((nYear = 3000)
| |(NMON的 12)
| |(n天 31) )
{
nRetVal = 1;
* npWeekDay = -1;
回报nRetVal;
}
/ / memset的(tmMyDate,大小,0,(结构TM));
tmMyDate.tm_year = nYear-1900;
tmMyDate.tm_mon = NMON-1;
tmMyDate.tm_mday = n天;
tmMyDate.tm_hour = 16; BR /> tmMyDate.tm_min = 30;
tmMyDate.tm_sec = 30;
tMyDateTime的的mktime(与tmMyDate);
(tMyDateTime <0)
{
nRetVal = 1;
* npWeekDay = -1;
回报nRetVal;
}
tmpMyDate = localtime的(tMyDateTime);
npWeekDay = tmpMyDate - > tm_wday
返回nRetVal的;
}
包括
#包括
诠释GetWeekDay(nYear,诠释NMON,INT n天,INT * npWeekDay);
廉政的main()
{
诠释nMyWeekDay;
诠释nResult;
nResult = GetWeekDay(2007年,1,10,及nMyWeekDay);
返回0;
}
/ /输入日期,返回星期的C语言函数
诠释GetWeekDay(nYear,NMON,诠释nDay,诠释* npWeekDay)
{
诠释nRetVal = 0;
time_t的tMyDateTime;
结构TM tmMyDate,tmpMyDate;
>
((nYear = 3000)
| |(NMON的 12)
| |(n天 31) )
{
nRetVal = 1;
* npWeekDay = -1;
回报nRetVal;
}
/ / memset的(tmMyDate,大小,0,(结构TM));
tmMyDate.tm_year = nYear-1900;
tmMyDate.tm_mon = NMON-1;
tmMyDate.tm_mday = n天;
tmMyDate.tm_hour = 16; BR /> tmMyDate.tm_min = 30;
tmMyDate.tm_sec = 30;
tMyDateTime的的mktime(与tmMyDate);
(tMyDateTime <0)
{
nRetVal = 1;
* npWeekDay = -1;
回报nRetVal;
}
tmpMyDate = localtime的(tMyDateTime);
npWeekDay = tmpMyDate - > tm_wday
返回nRetVal的;
}
全部回答
- 1楼网友:低血压的长颈鹿
- 2021-02-14 11:39
你好!
你应该去看看日历代码!
取月份值,然后排序!
根本不找到你要什么代码! VB? C#?
如果对你有帮助,望采纳。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯