java关于日历的小程序 20
....................................inti=1;int[]months=newint[]{0,31,28,31,30,31,30,3...
....................................
int i=1;
int [] months =new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30,31..........};
int [] blank = new int[600]; blank[0]=7;
do
{
blank[i]=42-months[i]-(7-blank[i-1]);
if(blank[i]>7&&blank[i]%7==0) blank[i]=7;
if(blank[i]>7&&blank[i]%7!=0) blank[i]=blank[i]%7;
i++;
}while(i>=600);
l=blanks[12*(year-1970)+month-1];
for(i=1;i<=4*(7-l)+1;i++)
{
System.out.print(" ");
}
........................
为什么从1970年3月以后1号,2号前面的空格都是这样的??(空格数量用l=blanks[12*(year-1970)+month-1];定义的) 展开
int i=1;
int [] months =new int[]{0,31,28,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30,31..........};
int [] blank = new int[600]; blank[0]=7;
do
{
blank[i]=42-months[i]-(7-blank[i-1]);
if(blank[i]>7&&blank[i]%7==0) blank[i]=7;
if(blank[i]>7&&blank[i]%7!=0) blank[i]=blank[i]%7;
i++;
}while(i>=600);
l=blanks[12*(year-1970)+month-1];
for(i=1;i<=4*(7-l)+1;i++)
{
System.out.print(" ");
}
........................
为什么从1970年3月以后1号,2号前面的空格都是这样的??(空格数量用l=blanks[12*(year-1970)+month-1];定义的) 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏20(财富值+成长值)
1个回答
2014-10-26
展开全部
输出完空格,给一个回车。。。。。。代码不完整,调试不了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询