当前位置:首页 » 操作系统 » 源码日

源码日

发布时间: 2022-03-01 08:33:34

‘壹’ c语言 日期计算加一天 源代码

scanf
("%fa
%fb
%fc",&a,&b,&c);貌似"%fa
%fb
%fc"有点问题
最好定义abc为int类型,sacnf("%d
%d
%d",&a,&b,&c);
还有就是你的没输出,你可以把
if
(b==1||b==3||b==5||b==7||b==8||b==10||
b==12
&&c<31
)
c++
;
改为
if
(b==1||b==3||b==5||b==7||b==8||b==10||
b==12
&&c<31
)
{
c++
;
printf("%d
%d
%d",a,b,c);
}
就行了,没按你说的功能来做,只是实现你的那个例子

‘贰’ 高分!!有没有相关的工作日历源码,js或java,可以自己定制工作日与休息日~~谢!

<SCRIPT LANGUAGE="JavaScript" >
function runClock() {
var today = new Date();
var display= today.toLocaleString();
if(document.layers){document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}else if(document.all)
liveclock.innerHTML=display
setTimeout("runClock()",1000)
}

<%
String userGuid = "";
if(session.getAttribute("userGUID1")!=null){
userGuid = session.getAttribute("userGUID1").toString();
}
int check = 0;
check = new DayRemindCheck().getCheck(userGuid);
if(check>0){
%>
window.open("dayRemind.jsp","每日提醒","toolbar =no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,width=500,height=300");
<%}%>
<!-- Begin

var now = new Date();
var month_array = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
document.write("<form name=date_list><table bgcolor=silver width=250 ><tr><td width=250>");
document.write("<select name=month onchange=change_month(this.options.selectedIndex)>");
for(i=0;i<month_array.length;i++)
{
if (now.getMonth() != i)
{document.write ("<option value="+i+">"+month_array[i]);}
else
{document.write ("<option value="+i+" selected>"+month_array[i]);}

}
document.write("</select>");
document.write("</td><td>");
document.write ("<select name=year onchange=change_year(this.options[this.options.selectedIndex])>");
for(i=1950;i<3000;i++)
{
if (now.getYear() != i)
{document.write("<option value="+i+">"+i);}
else
{document.write("<option value="+i+" selected>"+i);}
}
document.write("</select></td></tr><tr><td colspan=2><center>");

document.write("<table bgcolor=white border=0 cellspacing = 0 cellpading = 0 width=252 ><tr bgcolor=gray align=center >");
document.write("<td ><font color=silver>一</font></td><td><font color=silver>二</td><td><font color=silver>三</td><td><font color=silver>四</td><td><font color=silver>五</td><td ><font color=silver>六</td><td ><font color=silver>日</td>");
document.write("</tr><tr>");
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
document.write("<td align=center id=d"+i+"r"+j+" style='cursor:hand; height=10px' onclick=getDate()></td>")
}
document.write("</tr>");
}

document.write("</table>");

document.write("</center></from></td></tr></table>");

var show_date = new Date();

function set_cal(show_date)
{
begin_day = new Date (show_date.getYear(),show_date.getMonth(),1);
begin_day_date = begin_day.getDay();
end_day = new Date (show_date.getYear(),show_date.getMonth()+1,1);
count_day = (end_day - begin_day)/1000/60/60/24;
input_table(begin_day_date,count_day);
}
set_cal(show_date);

function input_table(begin,count)
{
init();
j=0;
if (begin!=0){i=begin-1;}else{i=6}
for (c=1;c<count+1;c++)
{
colum_name = eval("d"+i+"r"+j);
if ((now.getDate() == c)&&(show_date.getMonth() == now.getMonth())&&(show_date.getYear() == now.getYear())) {colum_name.style.backgroundColor = "blue";colum_name.style.color = "white";};
colum_name.innerText = c;
i++;
if (i==7){i=0;j++;}
}
}

function init()
{
for(j=0;j<6;j++)
{
for(i=0;i<7;i++)
{
colum_name = eval("d"+i+"r"+j);
colum_name.innerText = " ";
colum_name.style.backgroundColor ="";
colum_name.style.color ="";
}
}
}

function change_month(sel_month)
{
show_date = new Date(show_date.getYear(),sel_month,1);
set_cal(show_date);
}

function change_year(sel_year)
{
sel_year = sel_year.value;
show_date = new Date(sel_year,show_date.getMonth(),1);
set_cal(show_date);
}
// End -->
</script>

‘叁’ php源码每日登陆奖励的实现

数据库中增加last_login_time字段记录最后一次的登录时间,
$last_login_time=rs["$last_login_time"];//调用数据库中存储的时间,一般存储为时间戳 存储格式为时间戳的话就得 $last_login_time=date("Ymd",rs["$last_login_time"]);
$now_time=date("Ymd",mktime());
//判断是否需要积分 如果是同一天登陆 则不计分 否则执行积分操作 更新最后登录时间
if($now_time>$last_login_time)
{
echo "积分";
//执行积分操作
$str="update user_info set score=score+10,set last_login_time='".mktime()."' where user_id=".$_SESSION["id"];
@mysql_query($str) or die ("服务器出错,请稍后再来");

}
else
{
echo "不计分";

//只更新最后登录时间
$str="update user_info set last_login_time='".mktime()."' where user_id=".$_SESSION["id"];
@mysql_query($str) or die ("服务器出错,请稍后再来");
}

‘肆’ C语言 日期计算加一天 源代码

scanf ("%fa %fb %fc",&a,&b,&c);貌似"%fa %fb %fc"有点问题
最好定义abc为int类型,sacnf("%d %d %d",&a,&b,&c);
还有就是你的没输出,你可以把
if (b==1||b==3||b==5||b==7||b==8||b==10|| b==12 &&c<31 ) c++ ;
改为
if (b==1||b==3||b==5||b==7||b==8||b==10|| b==12 &&c<31 )
{
c++ ;
printf("%d %d %d",a,b,c);
}
就行了,没按你说的功能来做,只是实现你的那个例子

‘伍’ 求一个标准北京时间的源代码,只要时间不要日期的,我要插入到自己的网页!

<script language="JavaScript"> <!-- function get_time(){ var date = new Date(); var year = "", month = "", day = "", week = "", hour = "", minute = "", second = ""; year = date.getYear(); month = add_zero(date.getMonth() + 1); day = add_zero(date.getDate()); week = date.getDay(); switch (date.getDay()){ case 0: val = "星期天"; break case 1: val = "星期一"; break case 2: val = "星期二"; break case 3: val = "星期三"; break case 4: val = "星期四"; break case 5: val = "星期五"; break case 6: val = "星期六"; break } hour = add_zero(date.getHours()); minute = add_zero(date.getMinutes()); second = add_zero(date.getSeconds()); time_div.innerText = hour + ":" + minute + ":" + second ; } function add_zero(temp){ if(temp < 10) return "0" + temp; else return temp; } setInterval("get_time()", 1000); //--> </script> <font class="w12"><b> <div id="time_div"></div> </b></font>

‘陆’ 求一个新浪博客上的日历源代码

<embed id=show_swf1 src=" http://www.ik68.cn/swf/12_.swf" width="183" height="202" wmode="transparent" type="application/x-shockwave-flash"> <embed id=show_swf1 src=" http://www.ik68.cn/swf/11_.swf" width="183" height="202" wmode="transparent" type="application/x-shockwave-flash"> <embed id=show_swf1 src=" http://www.ik68.cn/swf/9_.swf" width="183" height="202" wmode="transparent" type="application/x-shockwave-flash"> <embed id=show_swf1 src=" http://www.ik68.cn/swf/8_.swf" width="183" height="202" wmode="transparent" type="application/x-shockwave-flash"> <embed id=show_swf1 src=" http://www.ik68.cn/swf/4_.swf" width="183" height="202" wmode="transparent" type="application/x-shockwave-flash"> <embed id=show_swf1 src=" http://www.ik68.cn/swf/2_.swf" width="183" height="202" wmode="transparent" type="application/x-shockwave-flash"> 以上六个或许对你有用

‘柒’ c语言素日期源代码

#include<stdio.h>
intisPrim(intn)
{
inti;
if(n<2)
return0;
for(i=2;i*i<n;i++)
{
if(n%i==0)
return0;
}
return1;
}

intmain(void)
{
inta,b;
inti,c=0;

printf("输入第一个人的生日:");
scanf("%d",&a);
printf("输入第二个人的生日:");
scanf("%d",&b);
for(i=a+1;i<b;i++)
{
if(isPrim(i))
c++;
}
if(isPrim(c))
printf("缘分绝佳! ");
else
printf("缘分一般。 ");
return0;
}

大体意思是这样,日期的合法性判断比较繁琐,不在这里详说了。

‘捌’ 电视家国外代源码日本的和韩国的有吗

没看见分享码,这帮大侠谢的什么呢?

热点内容
沧州的编程 发布:2024-09-22 22:18:58 浏览:834
安卓为什么切换到鸿蒙有些软件不见了 发布:2024-09-22 22:14:48 浏览:894
什么可以缓解压力 发布:2024-09-22 21:54:03 浏览:50
android线程调用 发布:2024-09-22 21:33:11 浏览:796
访问宁静 发布:2024-09-22 21:31:09 浏览:246
使用命令窗口编译java 发布:2024-09-22 21:25:23 浏览:164
md5加密函数 发布:2024-09-22 21:02:32 浏览:702
成都php工资 发布:2024-09-22 20:55:16 浏览:438
sql表删除恢复 发布:2024-09-22 20:50:12 浏览:443
python字符串查找中文 发布:2024-09-22 20:50:12 浏览:596