谁帮我用mfc做个界面~~~急用~
明天中午之前,帮我把下面这段程序做成结果窗口界面显示出来~搞好再送50分~#include<stdio.h>#include<time.h>intJgYr(intyr){...
明天中午之前,帮我把下面这段程序做成结果窗口界面显示出来~
搞好再送50分~
#include <stdio.h>
#include <time.h>
int JgYr(int yr)
{
if (yr%4==0&&yr%100!=0¦¦yr%100==0&&yr%400==0)
return 1;
else
return 0;
}
int CalWkd(int yr,int mth)
{
int ds=0,i,rst,wkd;
int mthd[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if (JgYr(yr))
mthd[2]=29;
for (i=1;i<mth;i++)
ds+=mthd[i];
ds+=1;
rst=yr-1+(int)((yr-1)/4)-(int)((yr-1)/100)+(int)((yr-1)/400)+ds;
wkd=rst%7;
return wkd;
}
void getday(int *yr,int *mth)
{
long t;
struct tm *it;
time(&t);
it = localtime(&t);
*yr = it->tm_year + 1900;
*mth = it->tm_mon +1;
printf("%d年%d月%d号星期%d\n",it->tm_year +1900,it->tm_mon+1,it->tm_mday,it->tm_wday);
printf("%d时%d分%d秒\n" ,it->tm_hour ,it->tm_min ,it->tm_sec);
}
showcld(int wkd,int mtd)
{
int dt=1,i,j=0;
printf("Sun\tMon\tTue\tWed\tThu\tFri\tSat\n");
for (i=0;i<wkd;i++)
{
printf("\t");
j++;
}
while (j!=7)
{
printf("%d",dt);
if (j<6)
printf("\t");
else
printf("\n");
dt++;
j++;
}
while (1)
{
for (j=0;j<7;j++)
{
printf("%d",dt);
if (j!=6)
printf("\t");
else
printf("\n");
if (dt!=mtd)
dt++;
else
return 0;
}
}
}
int main()
{
int yr,mth,mtd,wkd,mthd[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
while(1)
{
getday(&yr,&mth);
if (JgYr(yr))
mthd[2]=29;
mtd=mthd[mth];
wkd=CalWkd(yr,mth);
showcld(wkd,mtd);
system("cls");
}
} 展开
搞好再送50分~
#include <stdio.h>
#include <time.h>
int JgYr(int yr)
{
if (yr%4==0&&yr%100!=0¦¦yr%100==0&&yr%400==0)
return 1;
else
return 0;
}
int CalWkd(int yr,int mth)
{
int ds=0,i,rst,wkd;
int mthd[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if (JgYr(yr))
mthd[2]=29;
for (i=1;i<mth;i++)
ds+=mthd[i];
ds+=1;
rst=yr-1+(int)((yr-1)/4)-(int)((yr-1)/100)+(int)((yr-1)/400)+ds;
wkd=rst%7;
return wkd;
}
void getday(int *yr,int *mth)
{
long t;
struct tm *it;
time(&t);
it = localtime(&t);
*yr = it->tm_year + 1900;
*mth = it->tm_mon +1;
printf("%d年%d月%d号星期%d\n",it->tm_year +1900,it->tm_mon+1,it->tm_mday,it->tm_wday);
printf("%d时%d分%d秒\n" ,it->tm_hour ,it->tm_min ,it->tm_sec);
}
showcld(int wkd,int mtd)
{
int dt=1,i,j=0;
printf("Sun\tMon\tTue\tWed\tThu\tFri\tSat\n");
for (i=0;i<wkd;i++)
{
printf("\t");
j++;
}
while (j!=7)
{
printf("%d",dt);
if (j<6)
printf("\t");
else
printf("\n");
dt++;
j++;
}
while (1)
{
for (j=0;j<7;j++)
{
printf("%d",dt);
if (j!=6)
printf("\t");
else
printf("\n");
if (dt!=mtd)
dt++;
else
return 0;
}
}
}
int main()
{
int yr,mth,mtd,wkd,mthd[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
while(1)
{
getday(&yr,&mth);
if (JgYr(yr))
mthd[2]=29;
mtd=mthd[mth];
wkd=CalWkd(yr,mth);
showcld(wkd,mtd);
system("cls");
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询