关闭

作业

377人阅读 评论(0) 收藏 举报
import java.util.Scanner;




public class Iiasng001 {




public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int a;
int b;
int c;
System.out.println("请输入a");
a=input.nextInt();
System.out.println("请输入b");
b=input.nextInt();
System.out.println("请输入c");
c=input.nextInt();

int temp;
if(a>b)
{
temp=a;
a=b;
b=temp;
}
if(a>c)
{
temp=a;
a=c;
c=temp;
}
if(b>c)
{
temp=b;
b=c;
c=temp;

}
System.out.println("a"+a);
System.out.println("b"+b);
System.out.println("c"+c);




}


}












import java.util.Scanner;




public class Iaini {




public static void main(String[] args) {
Scanner input=new Scanner(System.in);
char name;
int pwd;
System.out.println("请输入用户名");
name=input.next().charAt(0);
pwd=input.nextInt();
if(name=='姜'&&pwd==123)
{
System.out.println("欢迎你姜龙");
}else{
System.out.println("对不起,你不是姜龙");


}




}


}











Scanner input=new Scanner(System.in);
System.out.println("请输入成绩");
int score=input.nextInt();
if (score == 100){
System.out.println("奖励一个奖状");
}else{
System.out.println(" 抄一百遍作业");
}







package cn.jbit.cn01.test;


import java.util.Scanner;


public class Tast {


/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int score1 = 90;    //成绩
int score2 = 100; 
int score3 = 90; 
int mingci = 101;  //名次
if ( (score1 == 100 || score2 == 100 || score3 == 100) && mingci <= 100){
System.out.println("实验班");
} else {
System.out.println("普通班");

}
}


}








import java.util.Scanner;


public class Ejhj {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入考试名次");
int mingci = input.nextInt();
switch (mingci) {
case 1:
System.out.println("参加夏令营");
break;
case 2:
System.out.println("奖励笔记本");
break;
case 3:
System.out.println("奖移动硬盘");
break;
default:
System.out.println("没有奖励");
break;
}


}


}







import java.util.Scanner;


public class Ejlkj {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("我行我素购物管理系统--幸运抽奖");
System.out.println("请输入会员号");
int cardNo = input.nextInt();
int num = (int) (Math.random() * 10);
if ((cardNo / 100 % 10) == num) {
System.out.println(cardNo + "奖励一个MP3");
} else {
System.out.println("谢谢支持");
}
}
}









import java.util.Scanner;


public class Jiang {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入名次");
int mingci = input.nextInt();
if (mingci <= 10) {
System.out.println("发一本书和一支笔");
} else if (mingci <= 50 && mingci > 10) {
System.out.println("发一本书");
} else if (mingci <= 100 && mingci > 50) {
System.out.println("发一支笔");
} else if (mingci > 100) {
System.out.println("什么都没有");
}
}


}






import java.util.Scanner;


public class Rajklj {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String msg = "";
System.out.println("请输入消费金额");
double money = input.nextDouble();
System.out.println("是否参加优惠活动:");
System.out.println("1:满50元,加2元换购百事可乐饮料1瓶");
System.out.println("2:满100元,加3元换购500ml可乐1瓶");
System.out.println("3:满100元,加10元换购5公斤面粉");
System.out.println("4:满200元,加10元换购1个苏波尔炒菜锅");
System.out.println("5:满200元,加20元换购欧莱雅爽肤水1瓶");
System.out.println("0:不换购\n");
System.out.println("请选择\n");
if (input.hasNextInt() == true) {
int num = input.nextInt();
switch (num) {
case 1:
if (money < 50) {
System.out.println("金额不足");
} else {
money += 2;
msg = "成功换购百事可乐一瓶";
}
break;
case 2:
if (money < 100) {
System.out.println("金额不足");
} else {
money += 3;
msg = "500ml可乐1瓶";
}
break;
case 3:
if (money < 100) {
System.out.println("金额不足");
} else {
money += 10;
msg = "5公斤面粉";
}
break;
case 4:
if (money < 200) {
System.out.println("金额不足");
} else {
money += 10;
msg = "苏波尔炒菜锅";
}
break;
case 5:
if (money < 200) {
System.out.println("金额不足");
} else {
money += 20;
msg = "欧莱雅爽肤水1瓶";
}
break;
default:
msg="不换购";
break;
}
System.out.println("本次消费金额为" + money);
System.out.println("成功换购:" + msg);


}
}
}









import java.util.Scanner;


public class Wqqqq {


/**
* @param args
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("输入年级名次");
int mingci1 = input.nextInt();
System.out.println("输入历史单科名次");
int mingci2 = input.nextInt();
if (mingci1<=200)
{
if (mingci2<=50)
System.out.println("发奖品");
} else {
System.out.println("没奖品");
}


}


}





import java.util.Scanner;


public class IAJIS01 {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);
char name;
int pwd;
System.out.println("请输入用户名");
name = input.next().charAt(0);
pwd = input.nextInt();
if (name == '姜' && pwd == 123) {
System.out.println("欢迎你");
} else {
System.out.println("对不起,你不是姜龙");


}


}


}





0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:2863次
    • 积分:123
    • 等级:
    • 排名:千里之外
    • 原创:10篇
    • 转载:0篇
    • 译文:0篇
    • 评论:3条
    文章存档
    最新评论