如何用java编写带时钟的万年历代码,万年历要有阴历算法

2024-11-24 17:29:24
推荐回答(3个)
回答1:

如图: 

来源:http://www.javaeye.com/topic/735220

如调试不成功,我把源码发你信箱里

回答2:

import java.io.*;
class putout{
public void putout(int f,int x,int y){
int i;
int a[]= new int[40];
System.out.println(" 日 一 二 三 四 五 六 "+" "+f+"月");
for (i=0;i
for(i=x;i a[i]=i-x+1;
for(i=x;i {
if ((i%7==0)&&(i>0))
System.out.print("\n");
if (a[i]<10)
System.out.print(" "+a[i]);
else System.out.print(" "+a[i]);
}
System.out.println("\n");
}
}

class st{
public static void main(String args[])throws IOException{
putout p=new putout();
int year,mouth,y=1,t,i;
InputStreamReader ir;
BufferedReader in;
ir=new InputStreamReader(System.in);
in=new BufferedReader(ir);
System.out.print("请输入一个年份:");
String s=in.readLine();
year=Integer.parseInt(s);
if((year%4==0 && year%100!=0)||(year%400==0))
mouth=1;
else
mouth=0;
y=year;
for(i=1;i {if((i%4==0 && i%100!=0)||(i%400==0))
y++;}
y=y%7;
for(i=1;i<13;i++){
switch(i){
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
}
}
}
}

回答3:

<%@ page contentType="text/html;charset=UTF-8" %>