输入输出流汇总:
public class SiGuo {
public static void main(String[] args) {
//象棋口诀
char charOne='马';
char charTwo='象';
char charThree='卒';
//info
String name="李四";
String sex="男";
int age=25;
double height=1.76;
float weight=65.5f;
boolean marry=false;
//salary
int salary=4500;
int bonus=1000;
int insu=500;
int cash=(salary+bonus)-insu;
//%
int number01=15;
int number02=6;
int[] array= {1,2,3,8,9,6,7,1};
int mo=number01%number02;//取模运算
//三目运算
int grade=80;
String result=(grade<60)?"不及格":"及格";
//话费充值
int pay=10;
float price=0.2f;
int use=30;
float useCount=price*use;//语音计费
float flow=0.3f;
int useFlow=10;
float flowCount=useFlow*flow;//流量计费
//计算剩余多少话费
float payCount=pay-useCount-flowCount;
/*汇总结果*/
System.out.println(charOne+"走日,"+charTwo+"走田,"+"小"+charThree+"一去不复返
");
System.out.println("-----------------------------------------------");
System.out.println(" info");
System.out.println("-----------------------------------------------");
System.out.println("姓名: "+name);
System.out.println("性别: "+sex);
System.out.println("年龄: "+age);
System.out.println("身高: "+height+"米");
System.out.println("体重: "+weight+"千克");
System.out.println("结婚: "+"已婚");
System.out.println("-----------------------------------------------");
System.out.println("小李月收入:"+cash);
System.out.println("-----------------------------------------------");
System.out.println("取摸运算结果:"+mo);
for(int i=7;i>=0;i--) {
System.out.print(array[i]);
}
System.out.println("-----------------------------------------------");
System.out.println("成绩是否及格:"+result);
System.out.println("-----------------------------------------------");
System.out.println("话费余额:"+payCount);
}
}