语句小结
来源:互联网 发布:数据库备份与恢复目的 编辑:程序博客网 时间:2024/05/29 18:30
一、键入的方法代码:
1、int a=Integer.parseInt(args [0]);
2、Scanner inputscan=new Scanner(System.in);
int month=inputscan.nextInt();
二、语句分为:
分支
if ,else if ,else ,switch
循环
while, do....while, for
跳出
break, continu,
以下为switch语句的代码实现:
package com.ss;
import java.util.Scanner;
public class Sll {
public static void main(String[] args) {
Scanner inputscan=new Scanner(System.in);
int month=inputscan.nextInt();
switch(month)
{
case 2:
System.out.println(month+"月有28天!");
break;
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
System.out.println(month+"月有31天!");
break;
case 4:
case 6:
case 9:
case 11:
System.out.println(month+"月有30 天");
break;
default:
System.out.println("请输入12以内的数字!");
break;
}
}
}
阅读全文
0 0
- 语句小结
- 简单SQL语句小结
- 简单SQL语句小结
- jstl--sql 语句小结
- 简单SQL语句小结
- SQL基本语句小结
- 数据库操作语句小结
- 简单SQL语句小结
- SQL语句小结
- 简单SQL语句小结
- 简单SQL语句小结
- 简单SQL语句小结
- 简单SQL语句小结
- oracle sql语句小结
- SQL 语句小结
- SQL查询语句小结
- oracle循环语句小结
- oracle循环语句小结
- python序列操作--元祖,列表
- lucene的原理
- leetcode 665. Non-decreasing Array
- 天池大赛o2o优惠券第一名代码笔记之_xgb
- 由一个关系拟合拓展的
- 语句小结
- [LeetCode] 494. Target Sum
- 程序员:你为什么要离职?
- ALLPlayer(全能视频播放器)官方正式版V7.6下载 | allplayer官网下载
- 解决android studio中9-Patch问题
- svn使用
- Android Go 功能与新特性
- js绘制中国地图
- Kotlin之常用操作符