网上有关“怎么用C语言编写万年历程序”话题很是火热,小编也是针对怎么用C语言编写万年历程序寻找了一些与之相关的一些信息进行分析,如果能碰巧解决你现在面临的问题,希望能够帮助到您。
您好:手机麻将有挂是真的吗这款游戏可以开挂,确实是有挂的,咨询加微信【】很多玩家在这款游戏中打牌都会发现很多用户的牌特别好,总是好牌,而且好像能看到其他人的牌一样。所以很多小伙伴就怀疑这款游戏是不是有挂,实际上这款游戏确实是有挂的
1.手机麻将有挂是真的吗这款游戏可以开挂,确实是有挂的,通过添加客服微信
2.咨询软件加微信【】在"设置DD功能DD微信手麻工具"里.点击"开启".
3.打开工具.在"设置DD新消息提醒"里.前两个选项"设置"和"连接软件"均勾选"开启"(好多人就是这一步忘记做了)
4.打开某一个微信组.点击右上角.往下拉."消息免打扰"选项.勾选"关闭"(也就是要把"群消息的提示保持在开启"的状态.这样才能触系统发底层接口)
万年历
#include "stdio.h" /* Required for MS-DOS use */
#define ENTER 0x1C0D /* Enter key */
int year, month, day;
static char *days[8] = {" ","Sunday ","Monday ","Tuesday ",
"Wednesday","Thursday ","Friday ","Saturday "};
struct TIMEDATE {
int year; /* year 1980..2099 */
int month; /* month 1=Jan 2=Feb, etc. */
int day; /* day of month 0..31 */
int hours; /* hour 0..23 */
int minutes; /* minute 0..59 */
int seconds; /* second 0..59 */
int hsecs; /* 1/100ths of second 0..99 */
char dateline[47]; /* date & time together */
};
static struct TIMEDATE today;
main()
{
char cmonth[3];
char cday[3];
char cyear[5];
double getdays();
double daynumb, numbnow;
int weekday, retcode, dayer, i;
dayer = datetime(&today);
clrscn();
for (i=0;i<3;++i)cmonth[i]='\0';
for (i=0;i<3;++i)cday[i]='\0';
for (i=0;i<5;++i)cyear[i]='\0';
putstr(5,8,14,"Enter date in MM DD YYYY format:");
while (retcode != ENTER)
{
retcode = bufinp(5,41,13,2,cmonth);
if (retcode != ENTER) retcode = bufinp(5,44,13,2,cday);
if (retcode != ENTER) retcode = bufinp(5,47,13,4,cyear);
}
year = atoi(&cyear);
month = atoi(&cmonth);
day = atoi(&cday);
daynumb = getdays(year, month, day);
numbnow = getdays(today.year, today.month, today.day);
weekday = weekdays(daynumb);
if (numbnow - daynumb == 0)
printf("\n\n%02d-%02d-%d is",month, day, year);
if (numbnow - daynumb > 0)
printf("\n\n%02d-%02d-%d was",month, day, year);
if (numbnow - daynumb < 0)
printf("\n\n%02d-%02d-%d will be",month, day, year);
printf(" a %s\n",days[weekday]);
} /* end MAIN */
/************************************************************
* GETDAYS - From integer values of year (YYYY), month *
* (MM) and day (DD) this subroutine returns a *
* double float number which represents the *
* number of days since Jan 1, 1980 (day 1). *
* This routine is the opposite of GETDATE. *
************************************************************/
double getdays(year, month, day)
int year, month, day;
{
int y,m;
double a,b,d, daynumb;
double floor(),intg();
/**********************************
** make correction for no year 0 **
**********************************/
if (year < 0) y = year + 1;
else y = year;
/*********************************************************
** Jan and Feb are months 13 and 14 in this calculation **
*********************************************************/
m = month;
if (month < 3)
{
m = m + 12;
y = y - 1;
}
/**************************
** calculate Julian days **
**************************/
d = floor(365.25 * y) + intg(30.6001 * (m + 1)) + day - 723244.0;
/**********************************************
** use Julian calendar if before Oct 5, 1582 **
**********************************************/
if (d < -145068.0) daynumb = d;
/*************************************
** otherwise use Gregorian calendar **
*************************************/
else
{
a = floor(y / 100.0);
b = 2 - a + floor(a / 4.0);
daynumb = d + b;
}
return(daynumb);
} /* end GETDAYS */
/********************************************************
* GETDATE - This routine takes a double float number *
* representing the number of days since Jan 1,*
* 1980 (day 1) and returns the year month and *
* day as pointer integers *
* This routine is the opposite of GETDAYS *
********************************************************/
getdate(numb)
double numb;
{
double a,aa,b,c,d,e,z;
double date;
date = numb;
z = intg(date + 2444239.0);
if (date < -145078.0) a = z;
else
{
aa = floor((z - 1867216.25) / 36524.25);
a = z + 1 + aa - floor(aa/4.0);
}
b = a + 1524.0;
c = intg((b - 122.1) / 365.25);
d = intg(365.25 * c);
e = intg((b - d) / 30.6001);
day = b - d - intg(30.6001 * e);
if (e > 13.5) month = e - 13.0;
else month = e - 1.0;
if (month > 2) year = c - 4716.0;
else year = c - 4715.0;
if (year < 1) --year;
return;
} /* end GETDATE */
/********************************************************
* WEEKDAYS - This routine takes a double float number *
* representing the number of days since Jan 1,*
* 1980 (day 1) and returns the day of the week*
* where 1 = Sunday, 2 = Tuesday, etc. *
********************************************************/
int weekdays(numb)
double numb;
{
double dd;
int day;
dd = numb;
while (dd > 28000.0) dd = dd - 28000.0;
while (dd < 0) dd = dd + 28000.0;
day = dd;
day = ((day + 1) % 7) + 1;
return(day);
}
/********************************************************
* FRACT - This routine takes a double float number *
* and returns the fractional part as a double *
* float number *
********************************************************/
double fract(numb)
double numb;
{
int inumb;
double fnumb;
while (numb < -32767) numb += 32767;
while (numb > 32767) numb -= 32767;
inumb = numb;
fnumb = inumb;
return(numb-fnumb);
} /* end FRACT */
/********************************************************
* FLOOR - This routine takes a double float number *
* and returns the next smallest integer *
********************************************************/
double floor(numb)
double numb;
{
double fract(), intg();
double out;
out = intg(numb);
if (numb < 0 && fract(numb) != 0) out -= 1.0;
return(out);
} /* end FLOOR */
/********************************************************
* INTG - This routine takes a double float number *
* and returns the integer part as a double *
* float number *
********************************************************/
double intg(numb)
double numb;
{
double fract();
return(numb - fract(numb));
} /* end INTG */
C语言程序设计万年历怎么编写
注意:下面的程序需要以命令行的格式运行,例如,把编绎好的可执行文件的名字为 filename,那要查看某2002/01/01就输入 filename 2002/02/01,要查看2002年1月份就输入filename 2002/01或filename2002/01/0。
/*** 万年历 ***/
/*** 命令行:
若查看某一天,例如 calen 2001/12/28
若查看某个月,例如 calen 2001/12/0 或 calen 2001/12
***/
/**************************************************
1. 以2000/01/01日为星期六为基准。
2. dy为该年 1月1号 到2000年1月1号的 " 星期差 "
3. dm为该月以前的月所引起的 " 星期差 "
4. m2为二月所引起的 " 星期差 "
**************************************************/
main(int x,char **date)
{
int year=0,month=0,day=0,week;
int d,i,dm,dy,m2;
char WEEK[9];
if (x==1)
{
printf ("\n ERROR! you forgot to enter the date you want to view\n");
exit (0);
}
i=0; d=-1;
while (date[1][i])
{
if ((date[1][i]=='/'||date[1][i]=='.')&&d==-1) { d=0; i++; continue; }
if ((date[1][i]=='/'||date[1][i]=='.')&&d==0) { d=1; i++; continue; }
if (d==-1) year=year*10+(date[1][i]-'0');
if (d==0) month=month*10+(date[1][i]-'0');
if (d==1) day=day*10+(date[1][i]-'0');
i++;
}
if (month<1||month>12)
{ printf ("\n ERROR! the entered MONTH is invalid\n"); exit (0); }
if (year==2000) { dy=0; m2=1; goto la_100; }
if (year>2000) d=(year-1-2000)/4-(year-1-2000)/100+(year-1-2000)/400+1;
else d=(year-2000)/4-(year-2000)/100+(year-2000)/400;
dy=(year-2000)+d; /*** 该年 1月1号 到2000年1月1号的 " 星期差 " ***/
if((year%4==0&&year%100!=0)||(year%100==0&&year%400==0))
m2=1; else m2=0; /*** 该年是否润 ***/
la_100: /**** la_100 ****/
/*** 该月以前的月所引起的 " 星期差 " ***/
switch (month)
{
case 1: dm=0; month=31; break; /*** month 在此存放该月天数 ***/
case 2: dm=3; month=d==1? 29:28; break;
case 3: dm=3+m2; month=31; break;
case 4: dm=6+m2; month=30; break;
case 5: dm=1+m2; month=31; break;
case 6: dm=4+m2; month=30; break;
case 7: dm=6+m2; month=31; break;
case 8: dm=2+m2; month=31; break;
case 9: dm=5+m2; month=30; break;
case 10: dm=m2; month=31; break;
case 11: dm=3+m2; month=30; break;
case 12: dm=5+m2; month=31; break;
}
if (day<0||day>month)
{ printf ("\n ERROR! the entered DAY is invalid\n"); exit (0); }
week=(dy+dm+day-1+6)%7; if(week<0) week+=7;
if (day>0) /*** 判断查看类型 ***/
{
switch (week)
{
case 0: strcpy (WEEK,"SUNDAY"); break;
case 1: strcpy (WEEK,"MONDAY"); break;
case 2: strcpy (WEEK,"TUESDAY"); break;
case 3: strcpy (WEEK,"WEDNESDAY"); break;
case 4: strcpy (WEEK,"THURSDAY"); break;
case 5: strcpy (WEEK,"FRIDAY"); break;
case 6: strcpy (WEEK,"SATURDAY"); break;
}
printf ("\n this day is %s \( %d \)\n\n OK!\n",WEEK,week);
}
else
{
week=++week%7;
printf ("\n the calender of this month as following\n");
printf ("\n *********************************\n");
printf (" SUN MON TUE WEN THU FRI STA\n");
for (i=0;i<week;i++) printf (" ");
for (i=1;i<=month;i++)
{ printf (" %2d ",i); week++; if (week%7==0&&i!=month) printf ("\n"); }
printf ("\n *********************************\n");
printf ("\n OK!\n");
}
}
#include <stdio.h>
int IsLeapYear(int);
main()
{
int i;
int day;
int year;
int temp;
int temp_i;
long int Year_days = 0;
int Year_Start = 1;
int Per_Year_Days;
int month_day[]={31,28,31,30,31,30,31,31,30,31,30,31,29};
printf("Please enter the year: ");
scanf("%d",&year);
while(Year_Start < year)
{
if( IsLeapYear( Year_Start ) )
Per_Year_Days = 366;
else
Per_Year_Days = 365;
Year_days = Year_days + Per_Year_Days;
Year_Start++;
}
for( temp = 1; temp <=12; temp++ )
{
switch( temp )
{
case 1:
printf(" January(%d)\n",year);
break;
case 2:
printf(" February(%d)\n",year);
break;
case 3:
printf(" March(%d)\n",year);
break;
case 4:
printf(" April(%d)\n",year);
break;
case 5:
printf(" May(%d)\n",year);
break;
case 6:
printf(" June(%d)\n",year);
break;
case 7:
printf(" July(%d)\n",year);
break;
case 8:
printf(" August(%d)\n",year);
break;
case 9:
printf(" September(%d)\n",year);
break;
case 10:
printf(" October(%d)\n",year);
break;
case 11:
printf(" November(%d)\n",year);
break;
case 12:
printf(" December(%d)\n",year);
break;
}
i = Year_days % 7;
printf("Mon Tue Wed Thu Fri Sat Sun\n");
if( i != 0 )
for( temp_i = 0; temp_i < i; temp_i++)
printf(" ");
day = 1;
if( IsLeapYear(year) && temp == 2)
while( day <= month_day[12] )
{
if( day >1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >= 10 )
printf("%d ",day);
else
printf("%d ",day);
Year_days++;
day++;
}
else
while (day <= month_day[temp-1])
{
if( day > 1 )
if( Year_days % 7 == 0 )
printf("\n");
if( day >=10 )
printf("%d ",day);
else
printf("%d ",day);
Year_days++;
day++;
}
printf("\n");
if( getch() == 'q' )
exit(0);
}
getch();
}
int IsLeapYear( int year )
{
if ((year %4 == 0) && (year % 100 != 0) ||
(year % 400 == 0) )
return 1;
else
return 0;
}
关于“怎么用C语言编写万年历程序”这个话题的介绍,今天小编就给大家分享完了,如果对你有所帮助请保持对本站的关注!