课程: Java趣味入门教程 章节:
13 道题
#1
难度:
(5.1讲)
描述:
给定3个整数,求它们的乘积。
		int a = 123;
		int b = 23;
		int c = 9;
求a,b,c的乘积。并打印输出。
答案 去问
#2
难度:
(5.1讲)
描述:
给定3个数a,b,c ,求它们的平方之和。

int a = 123;
int b = 23;
int c = 9;
求a,b,c的平方之和。并打印输出。
答案 去问
#3
难度:
(5.1讲)
口算出下表达式的值。并在Eclipse里验证。
描述:
在以下表达式中,result的值是多少?
(1) 
int  a = 10;
int  b = 20;
int  result = a * b;

(2) 
int result = 17 % 4 ;

(3) 
int result = 4 % 17;

(4) 
int result = 17 % 17;

(5)
int result = 13 / 5;

(6)
double result = 13.0 / 5.0;
答案 去问
#4
难度:
(5.3讲)
描述:
/////// 以下代码的输出是什么?
		int a = 12;
		double b = 13;
		boolean result = a > b;
		System.out.println("result: " + result);
答案 去问
#5
难度:
(5.3讲)
描述:
【口算】以下代码中 result的值是多少
(1)
boolean  result =  ( 13 >= 13 );

(2)
boolean result = (( 13 - 1 ) == 12) ;

(3)
boolean result =  (( 25 % 5) != 0);

(4)
int a = 3;
boolean result =  ( (a - 3) != (a + 3) );
答案 去问
#6
难度:
(5.4讲)
描述:
//// 以下代码的输出为?
		int a = 12;
		int b = 20;
		System.out.println("result: " +   (a >=12 && b < 24)   );
答案 去问
#7
难度:
(5.4讲)
描述:
// 以下代码的输出为?
		int a = 12;
		boolean result = (( a < 12 ) || true );		
		System.out.println("result: " + result );
答案 去问
#8
难度:
(5.4讲)
描述:
口算以下代码中的表达式的值。并在Eclipse中验证。

(1)
boolean result = true && false;

(2)
boolean result = false || false;

(3)
boolean result =  false || (3 > 2 );

(4)
boolean result =  ! true;

(5)
boolean result =  ! ( 3 > 2);

(6)
boolean a = false;
boolean  result =  ( 3 > 2 )  &&  ( !a );

(7) 
int a = 3;
boolean result =  ! ( a > 3 || a < 8);
答案 去问
#9
难度:
(5.6讲)
描述:
给定a,b,c的值,求它们的平均值
		int a = 123;
		int b = 23;
		int c = 2;
		int d = 453;
答案 去问
#10
难度:
(5.6讲)
描述:
以下代码 result的值是多少?

int result =  (int)  ( 18.9 / 3 );
答案 去问