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

java語言

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

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

計算機二級考試Java模擬試題及答案2017

  不積跬步,何以至千里。試題的規律都是從一點一滴積累而來。下面是小編整理的計算機二級考試Java模擬試題及答案,歡迎練習!

計算機二級考試Java模擬試題及答案2017

  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);

  m=y-x;

  System.out.println("最大數與最小數之差為"+m);

  }else

  {

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

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

  m=x-y;

  System.out.println("最大數與最小數之差為"+m);

  }

  }

  }

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

  x? (x>0)

  y=???? 0? (x=0)

  -x? (x<0)

  import java.io.*;

  public class testa

  {

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

  {

  float? x,y;

  y=0;

  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;

  }

  if(x==0)

  {

  y=0;

  }

  if(x<0)

  {

  y=-x;

  }

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

  }

  }

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

  x-1? (x>1)

  y=???? 0? (-1≤x≤1)

  x+10? (x<-1)

  import java.io.*;

  public class testa

  {

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

  {

  float? x,y;

  y=0;

  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>1)

  {

  y=x-1;

  }

  if(1.0>=x&&x>=-1.0)

  {

  y=0;

  }

  if(x<-1)

  {

  y=x+10;

  }

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

  }

  }

【計算機二級考試Java模擬試題及答案】相關文章:

計算機二級JAVA考試精選模擬試題12-02

計算機二級考試JAVA模擬試題03-03

計算機二級考試《Java》試題及答案03-30

計算機二級考試Java試題及答案12-04

全國計算機二級考試Java模擬試題答案及解析03-30

2016計算機二級考試Java試題及答案03-27

計算機二級Java考試鞏固試題及答案12-01

2016年計算機考試二級java模擬試題(含答案)03-17

73月計算機二級JAVA臨考模擬試題與答案03-30

主站蜘蛛池模板: 哈尔滨市| 依安县| 苗栗县| 湘阴县| 西畴县| 静宁县| 新兴县| 分宜县| 灵石县| 黔西县| 龙海市| 石景山区| 安岳县| 五大连池市| 金秀| 禹城市| 白沙| 青冈县| 白银市| 信阳市| 任丘市| 黎川县| 双柏县| 黑龙江省| 崇州市| 隆林| 永济市| 额尔古纳市| 巫溪县| 北碚区| 温泉县| 达拉特旗| 沅江市| 昌都县| 祁阳县| 高要市| 汉川市| 万源市| 化州市| 茌平县| 射阳县|