This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Number{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
System.out.println("请输入一个数a:"); | |
int a=input.nextInt(); | |
System.out.println("请再输入一个数b:"); | |
int b=input.nextInt(); | |
System.out.println("您输入的结果为:a="+a+" "+"b="+b); | |
int c=a; | |
a=b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Score{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
System.out.println("请输入你的成绩:"); | |
double score=input.nextDouble(); | |
if(score>=90&&score<=100){ | |
System.out.println("优秀"); | |
}else if(score>=80&&score<90){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Card{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
System.out.println("请输入卡的类型:金|银|铜"); | |
String type=input.next(); | |
System.out.println("请输入消费金额:"); | |
double money=input.nextDouble(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Compare{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
System.out.println("请输入三个整数:"); | |
int a=input.nextInt(); | |
int b=input.nextInt(); | |
int c=input.nextInt(); | |
int max=a>b?a:b; | |
max=max>c?max:c; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
System.out.println("请输入你的用户名:"); | |
String name=input.next(); | |
System.out.println("请输入密码:"); | |
String password=input.next(); | |
if(name.equals("tom")&&password.equals("123")){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class L4{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
String name; | |
do{ | |
System.out.println("请输入你的名字:"); | |
name=input.next(); | |
if(!name.equals("quit")){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Login{ | |
public static void main(String[] args){ | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
String lastName=""; | |
int errorNum=0; | |
boolean flag=false; | |
while(errorNum!=3&&!flag){ | |
System.out.println("请输入用户名:"); | |
String name=input.next(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GuessGame{ | |
public static void main(String[] args){ | |
java.util.Random random=new java.util.Random(); | |
java.util.Scanner input=new java.util.Scanner(System.in); | |
int errorNum=0; | |
int num=random.nextInt(100); | |
while(true){ | |
System.out.println("请输入一个100以内的整数:"); | |
int a=input.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class L5{ | |
public static void main(String[] args){ | |
int[] nums=new int[5]; | |
for(int a=0;a<nums.length;a++){ | |
System.out.println("请输入"+(a+1)+"个整数的值:"); | |
nums[a]=input.nextInt(); | |
} | |
System.out.println("你输入的数为:"); | |
for(int a=0;a<nums.length;a++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.kaishengit.entity; | |
import java.io.Serializable; | |
public class Account implements Serializable{ | |
private static final long serialVersionUID = 1L; | |
private int id; | |
private String username; | |
private int age; |
OlderNewer