最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

下面這個程序?qū)懰懒?,怎么把它變成面向?qū)ο髱?shù)的程序啊,求大家?guī)蛶兔?/h1>

public static void main(String[] args) {??boolean flag=true;??while(flag){???Scanner sc=new Scanner(System.in);???System.out.println("請輸入年份");???int year=sc.nextInt();???System.out.println("請輸入月份");???int month=sc.nextInt();???//當前月的天數(shù)???int currentDay=0;???//閏年計數(shù)???int count=0;???if(year<1900){????System.out.println("您輸入的年份不符合要求,請輸入大于1900的年份");????continue;???}???for(int i=1900;i<year;i++){????if((i%4==0&&i%100!=0)||i%400==0){?????count++;????}???}???int preYear=(year-1900)*365+count;???int totalMonthDay=0;???for(int i=1;i<=month;i++){????int days=0;????switch (i) {????case 2: {?????if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {??????days = 29;?????} else {??????days = 28;?????}?????break;????}????case 4:????case 6:????case 9:????case 11: {?????days = 30;?????break;????}????default:?????days = 31;?????break;????}????if(i==month){//當前月的天數(shù)?????currentDay=days;????}????????totalMonthDay+=days;???}???int week=(preYear+totalMonthDay-currentDay+1)%7;???System.out.println("星期天\t星期一\t星期二\t星期三\t星期四\t星期五\t星期六");???int blank=0;???//打印日期前空格???for(int i=1;i<=week;i++){???? blank++;???? System.out.print("\t");???}??//打印日期???for(int i=1;i<=currentDay;i++){????if(blank%7==0){?????System.out.println();????}????blank++;????System.out.print(i+"\t");???}???String l=sc.next();???System.out.println("繼續(xù)按Y");???if(l.equalsIgnoreCase("l")){????continue;???}???else{????System.out.println("退出系統(tǒng)");????break;???}??}?}
查看完整描述

2 回答

?
空空空空空空啊

TA貢獻2條經(jīng)驗 獲得超0個贊

已經(jīng)解決


查看完整回答
反對 回復 2018-09-02
?
流年4水0

TA貢獻10條經(jīng)驗 獲得超0個贊

真心沒明白你這要干嘛。這是控制臺main算日子?

查看完整回答
反對 回復 2018-08-28
  • 2 回答
  • 0 關注
  • 939 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號