我编辑的JAVA日历程序
2024-08-25 04:05:08
class calendar
{
public static void main(String[]args)
{
int yearIn ;
yearIn = Integer.parseInt(args[0]);
showDays(yearIn);
}
static void showDays(int year)
{ int month = 1;
out:
for(;month<13;month++)
{ switch(month)
{
case 1:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 2:
int count =0;
if((year % 4)!=0)
{count = 28;}
else if((year % 100==0)&(year % 400 != 0))
{count = 28;}
else
{count = 29;}
for(int day=1;day<=count;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 3:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 4:
for(int day = 1;day<31;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 5:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 6:
for(int day = 1;day<31;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 7:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 8:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 9:
for(int day = 1;day<31;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 10:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 11:
for(int day = 1;day<31;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
case 12:
for(int day = 1;day<32;day++)
{System.out.println(month+"月"+day+"日");
}
continue;
}
} } }
最新文章
- (四)SQL入门 数据库的操作与事务管理
- 【C语言】C语言常量和变量
- 滚动到底部加载更多及下拉刷新listview的使用
- table的css样式
- iOS ASIHTTPRequest 请求https
- JSP中RequestDispatcher的用法
- python矩阵运算 不断收集整理
- Android用自己的app替换Launcher
- 如果浏览器自动调用quirks模式打开的话
- android基本的数据库创建和使用
- 腾讯文学动作密集 疑为手Q发力移动阅读铺路
- python 打印类的属性、方法
- JAVA简便解析json文件
- ecstore中怎样使用ajax提交数据
- SEO网页优化
- 使用@property
- django学习,session与cookie
- null值经过强转会怎样?
- MySQL入门很简单-触发器
- 微信小程序基础