计算离一月一号过了c天后的那个月份的一号是星期几,0代表星期日
import java.util.Scanner;
public class Lianxi{
public static void main(String[] ags){
Scanner scan=new Scanner(System.in);
int a=scan.nextInt();
int []b={0,31,28,31,30,31,30,31,31,30,31,30,31};
int c=0,i,e=6,j,k=1;
for(i=1;i<a;i++){
c+=b[i];
}
e=(e+(c%7))%7;
System.out.println("一\t二\t三\t四\t五\t六\t日");
System.out.print("--------------------------\n");
for(i=1;i<=b[a];i++){
if(e!=1) {
for (j = 1; j < e; j++) {
System.out.print("\t");
k++;
}
e=1;
}
System.out.printf("%d",i);
System.out.print("\t");
if(k%7==0){
System.out.print("\n");
k=1;
}
else{
k++;
}
}
}
}