奶头挺立呻吟高潮av全片,成人试看120秒体验区,性欧美极品v,A片高潮抽搐揉捏奶头视频

java語言

計算機語言Java考試模擬試題附答案

時間:2024-10-13 10:49:44 java語言 我要投稿
  • 相關推薦

計算機語言Java考試模擬試題附答案

  科學的未來只能是屬于勤奮而又謙虛的年輕一代!以下是小編為大家搜索整理的計算機語言Java考試模擬試題附答案,希望能給大家帶來幫助!更多精彩內容請及時關注我們應屆畢業生考試網!

計算機語言Java考試模擬試題附答案

  1、編寫程序,計算下列分段函數的值。

  x? (x>=0)

  y=

  -x? (x<0)

  import java.io.*;

  public class testa

  { public static void main(String[] args) throws IOException

  {

  float? x,y;

  InputStreamReader reader=new InputStreamReader(System.in);

  BufferedReader input=new BufferedReader(reader);

  System.out.println("請輸入x:");

  String temp=input.readLine();

  x = Float.parseFloat(temp);

  if(x>=0)

  {

  y=x;

  }else

  {

  y=-x;

  }

  System.out.println("y="+y);

  }

  }

  2、根據年齡,判斷某人是否為成年。

  import java.io.*;

  public class testa

  {

  public static void main(String[] args) throws IOException

  {

  int x;

  InputStreamReader reader=new InputStreamReader(System.in);

  BufferedReader input=new BufferedReader(reader);

  System.out.println("請輸入x:");

  String temp=input.readLine();

  x = Float.parseFloat(temp);

  if(x>=18)

  {

  System.out.println("成年人");

  }

  if(x<18)

  {

  System.out.println("未成年");

  }

  }

  }

  3、判斷2020的奇偶性,并進行輸出。

  public class test

  {

  public static void main(String[] args)

  {

  int x;

  x=2020;

  if(x%2==0)

  System.out.println(+x+"是偶數");

  else

  System.out.println(+x+"不是偶數");

  }

  }

  4、比較兩個數的大小,找出其中的最大數并輸出。

  import java.io.*;

  public class ka

  { public static void main(String[] args) throws IOException

  {

  float? x,y,m;

  m=0;

  InputStreamReader readerx=new InputStreamReader(System.in);

  BufferedReader inputx=new BufferedReader(readerx);

  System.out.println("請輸入x:");

  String tempx=inputx.readLine();

  x = Float.parseFloat(tempx);

  InputStreamReader readery=new InputStreamReader(System.in);

  BufferedReader inputy=new BufferedReader(readery);

  System.out.println("請輸入y:");

  String tempy=inputy.readLine();

  y= Float.parseFloat(tempy);

  if(x>y)

  {

  m=x;

  }else

  {

  m=y;

  }

  System.out.println("最大數為"+m);

  }

  }

  5、比較兩個數的大小,找出其中的最小數并輸出。

  import java.io.*;

  public class ka

  { public static void main(String[] args) throws IOException

  {

  float? x,y,m;

  m=0;

  InputStreamReader readerx=new InputStreamReader(System.in);

  BufferedReader inputx=new BufferedReader(readerx);

  System.out.println("請輸入x:");

  String tempx=inputx.readLine();

  x = Float.parseFloat(tempx);

  InputStreamReader readery=new InputStreamReader(System.in);

  BufferedReader inputy=new BufferedReader(readery);

  System.out.println("請輸入y:");

  String tempy=inputy.readLine();

  y= Float.parseFloat(tempy);

  if(x{

  m=x;

  }else

  {

  m=y;

  }

  System.out.println("最小數為"+m);

  }

  }

  6、編寫一個Java程序,判斷某年份是否為閏年。

  import java.io.*;

  public class testa

  {

  public static void main(String[] args) throws IOException

  {

  float? x;

  InputStreamReader reader=new InputStreamReader(System.in);

  BufferedReader input=new BufferedReader(reader);

  System.out.println("請輸入x:");

  String temp=input.readLine();

  x =Float.parseFloat(temp);

  if(x@0==0)

  {

  System.out.println(+x+"是閏年");

  }

  else

  if(x%4==0)

  {

  System.out.println(+x+"是閏年");

  }

  else{ System.out.println(+x+"不是閏年");}

  }

  }

  7、比較兩個數的大小,找出其中的最大數和最小數并輸出。

  import java.io.*;

  public class ka

  { public static void main(String[] args) throws IOException

  {

  float? x,y;

  InputStreamReader readerx=new InputStreamReader(System.in);

  BufferedReader inputx=new BufferedReader(readerx);

  System.out.println("請輸入x:");

  String tempx=inputx.readLine();

  x = Float.parseFloat(tempx);

  InputStreamReader readery=new InputStreamReader(System.in);

  BufferedReader inputy=new BufferedReader(readery);

  System.out.println("請輸入y:");

  String tempy=inputy.readLine();

  y= Float.parseFloat(tempy);

  if(x{

  System.out.println("最小數為"+x);

  System.out.println("最大數為"+y);

  }else

  {

  System.out.println("最小數為"+y);

  System.out.println("最大數為"+x);

  }

  }

  }

  8、比較兩個數的大小,找出其中的最大數和最小數,并輸出最大數和最小數之差。

  import java.io.*;

  public class ka

  { public static void main(String[] args) throws IOException

  {

  float? x,y,m;

  InputStreamReader readerx=new InputStreamReader(System.in);

  BufferedReader inputx=new BufferedReader(readerx);

  System.out.println("請輸入x:");

  String tempx=inputx.readLine();

  x = Float.parseFloat(tempx);

  InputStreamReader readery=new InputStreamReader(System.in);

  BufferedReader inputy=new BufferedReader(readery);

  System.out.println("請輸入y:");

  String tempy=inputy.readLine();

  y= Float.parseFloat(tempy);

  if(x{

  System.out.println("最小數為"+x);

  System.out.println("最大數為"+y);

【計算機語言Java考試模擬試題附答案】相關文章:

2017年Java計算機考試模擬試題附答案09-05

java考試模擬練習試題08-30

Java模擬試題04-27

衛生資格內科主治醫師考試模擬試題附答案07-20

臨床執業助理醫師模擬試題附答案05-23

中醫助理執業醫師模擬試題附答案08-06

中醫執業助理醫師模擬試題附答案06-04

計算機二級考試Java模擬試題及答案201710-25

2017年學位英語考試題模擬預測附答案08-15

2017年初級護師考試全真模擬試題「附答案」09-01

主站蜘蛛池模板: 康保县| 海丰县| 施甸县| 天门市| 虹口区| 米林县| 福鼎市| 玉溪市| 宝坻区| 南宫市| 报价| 吉安市| 五指山市| 威宁| 策勒县| 靖江市| 师宗县| 依兰县| 林口县| 肃宁县| 达拉特旗| 余姚市| 于田县| 潼关县| 西华县| 蚌埠市| 宜川县| 武定县| 浮梁县| 江口县| 麻栗坡县| 云阳县| 贺兰县| 南阳市| 泽州县| 开江县| 宁波市| 铁岭县| 泽州县| 万荣县| 北碚区|