打印日历
2008-03-08 12:39:52 来源:WEB开发网核心提示:#include<stdio.h>#include<conio.h>main(){int i=0,m=0,k,j,n=0,l,first;int x[3]={1,25,50},y=1;int day(int);int a[2][13]={{31,28,31,30,31,30,31,31,30,3
#include<stdio.h>
#include<conio.h>
main()
{int i=0,m=0,k,j,n=0,l,first;
int x[3]={1,25,50},y=1;
int day(int);
int a[2][13]={{31,28,31,30,31,30,31,31,30,31,30,31},
{31,29,31,30,31,30,31,31,30,31,30,31}};
PRintf("\n\nplease input the year:");
scanf("%d",&i); l=i;
first=day(i);
if(i%4==0)k=1;
else k=0;
i=0;
while(m++<2)
{clrscr();
printf(" %d",l);
for(;i<6*m;i++)
{
if(i<6)y=(i/3)*8+2; else y=((i-6)/3)*8+2 ;
gotoxy(x[i%3],y);
printf(" %d",i+1);
gotoxy(x[i%3],++y);
printf(" su mo tu we th fr sa");
gotoxy(x[i%3],++y);
for(n=0;n<first;n++)
printf(" ");
for(j=1;j<=a[k][i];j++)
{printf("%3d",j);
if((first+j)%7==0)
gotoxy(x[i%3],++y);} first=(first+a[k][i])%7;
} if(m==1) printf("\n\nany key to continue");
else printf("\n\nAny key to end");
getch(); }
}
day(int i)
{int k,s=0;
if(i>2000)
{for(k=2000;k<i;k++)
if(k%4==0) s=s+366;
else s=s+365;
return((s+6)%7);}
else if(i=2000) return(5);
else
{for(k=i;k<2000;k++)
if(k%4==0)s=s+366;
else s=s+365;
return(7-(s+6)%7);}
}
#include<conio.h>
main()
{int i=0,m=0,k,j,n=0,l,first;
int x[3]={1,25,50},y=1;
int day(int);
int a[2][13]={{31,28,31,30,31,30,31,31,30,31,30,31},
{31,29,31,30,31,30,31,31,30,31,30,31}};
PRintf("\n\nplease input the year:");
scanf("%d",&i); l=i;
first=day(i);
if(i%4==0)k=1;
else k=0;
i=0;
while(m++<2)
{clrscr();
printf(" %d",l);
for(;i<6*m;i++)
{
if(i<6)y=(i/3)*8+2; else y=((i-6)/3)*8+2 ;
gotoxy(x[i%3],y);
printf(" %d",i+1);
gotoxy(x[i%3],++y);
printf(" su mo tu we th fr sa");
gotoxy(x[i%3],++y);
for(n=0;n<first;n++)
printf(" ");
for(j=1;j<=a[k][i];j++)
{printf("%3d",j);
if((first+j)%7==0)
gotoxy(x[i%3],++y);} first=(first+a[k][i])%7;
} if(m==1) printf("\n\nany key to continue");
else printf("\n\nAny key to end");
getch(); }
}
day(int i)
{int k,s=0;
if(i>2000)
{for(k=2000;k<i;k++)
if(k%4==0) s=s+366;
else s=s+365;
return((s+6)%7);}
else if(i=2000) return(5);
else
{for(k=i;k<2000;k++)
if(k%4==0)s=s+366;
else s=s+365;
return(7-(s+6)%7);}
}
[]
- ››打印书籍——Word 2007书籍排版完全手册(十)
- ››打印机控制技巧四则
- ››打印命令是在 Outlook 中选择多个附件丢失
- ››打印PowerPoint 2007幻灯片
- ››日历表的显示
- ››打印日历
- ››打印Memo的文本信息
- ››日历测试
- ››打印样式
- ››日历函数单元
- ››打印问题解决方案集锦
赞助商链接