第一天打卡
代码方面:
1. 基础的hello world输出:
package First;
/*Hello World输出*/
public class first {
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
2. 基础算术操作:
package First;
/*基本算术操作*/
public class first {
public static void main(String[] args)
{
int a,b;
a=9;
b=5;
int IntResult=0;
double x,y;
x=2.5;
y=4.2;
double DoubleResult=0;
/*加法*/
IntResult=a+b;
DoubleResult=x+y;
System.out.println(a+"+"+b+"="+IntResult);
System.out.println(x+"+"+y+"="+DoubleResult);
/*减法*/
IntResult=a-b;
DoubleResult=x-y;
System.out.println(a+"-"+b+"="+IntResult);
System.out.println(x+"-"+y+"="+DoubleResult);
/*乘法*/
IntResult=a*b;
DoubleResult=x*y;
System.out.println(a+"*"+b+"="+IntResult);
System.out.println(x+"*"+y+"="+DoubleResult);
/*除法*/
IntResult=a/b;
DoubleResult=x/y;
System.out.println(a+"/"+b+"="+IntResult);
System.out.println(x+"/"+y+"="+DoubleResult);
/*模运算*/
IntResult=a%b;
System.out.println(a+"%"+b+"="+IntResult);
}
}
单词背诵
考研词汇50字: