freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

最新java編程題全集(50題及答案)-文庫吧

2024-12-31 08:20 本頁面


【正文】 + 個(gè)三位數(shù))。}} 【程序12】題目:企業(yè)發(fā)放的獎(jiǎng)金根據(jù)利潤提成。利潤(I)低于或等于10萬元時(shí),獎(jiǎng)金可提10%;利潤高于10萬元,低于20萬元時(shí),低于10萬元的部分按10%提成,高于10萬元的部分,%;20萬到40萬之間時(shí),高于20萬元的部分,可提成5%;40萬到60萬之間時(shí)高于40萬元的部分,可提成3%;60萬到100萬之間時(shí),高于60萬元的部分,%,高于100萬元時(shí),超過100萬元的部分按1%提成,從鍵盤輸入當(dāng)月利潤,求應(yīng)發(fā)放獎(jiǎng)金總數(shù)?import .*。public class lianxi12 {public static void main(String[] args) { double x = 0,y = 0。 (輸入當(dāng)月利潤(萬):)。 Scanner s = new Scanner()。 x = ()。 if(x 0 amp。amp。 x = 10) { y = x * 。 } else if(x 10 amp。amp。 x = 20) { y = 10 * + (x 10) * 。 } else if(x 20 amp。amp。 x = 40) { y = 10 * + 10 * + (x 20) * 。 } else if(x 40 amp。amp。 x = 60) { y = 10 * + 10 * + 20 * + (x 40) * 。 } else if(x 60 amp。amp。 x = 100) { y = 20 * + 20 * + 20 * + (x 60) * 。 } else if(x 100) { y = 20 * + 40 * + 40 * + (x 100) * 。 } (應(yīng)該提取的獎(jiǎng)金是 + y + 萬)。}}【程序13】題目:一個(gè)整數(shù),它加上100后是一個(gè)完全平方數(shù),再加上168又是一個(gè)完全平方數(shù),請問該數(shù)是多少?public class lianxi13 {public static void main(String[] args) { for(int x =1。 x100000。 x++) { if((x+100) % 1 == 0) { if((x+268) % 1 == 0) { (x + 加100是一個(gè)完全平方數(shù),再加168又是一個(gè)完全平方數(shù))。 } } }}}/*按題意循環(huán)應(yīng)該從100開始(整數(shù)包括正整數(shù)、負(fù)整數(shù)、零),這樣會(huì)多一個(gè)滿足條件的數(shù)99。但是我看到大部分人解這道題目時(shí)都把題中的“整數(shù)”理解成正整數(shù),我也就隨大流了。*/【程序14】題目:輸入某年某月某日,判斷這一天是這一年的第幾天?import .*。public class lianxi14 {public static void main(String[] args) { int year, month, day。 int days = 0。 int d = 0。 int e。 input fymd = new input()。 do { e = 0。 (輸入年:)。 year =()。 (輸入月:)。 month = ()。 (輸入天:)。 day = ()。 if (year 0 || month 0 || month 12 || day 0 || day 31) { (輸入錯(cuò)誤,請重新輸入!)。 e=1 。 } }while( e==1)。 for (int i=1。 i month。 i++) { switch (i) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: days = 31。 break。 case 4: case 6: case 9: case 11: days = 30。 break。 case 2: if ((year % 400 == 0) || (year % 4 == 0 amp。amp。 year % 100 != 0)) { days = 29。 } else { days = 28。 } break。 } d += days。 } (year + + month + + day + 是這年的第 + (d+day) + 天。)。}}class input{public int input() { int value = 0。 Scanner s = new Scanner()。 value = ()。 return value。}}【程序15】題目:輸入三個(gè)整數(shù)x,y,z,請把這三個(gè)數(shù)由小到大輸出。import .*。public class lianxi15 {public static void main(String[] args) { input fnc = new input()。 int x=0, y=0, z=0。 (輸入第一個(gè)數(shù)字:)。 x = ()。 (輸入第二個(gè)數(shù)字:)。 y = ()。 (輸入第三個(gè)數(shù)字:)。 z = ()。 if(x y) { int t = x。 x = y。 y = t。 } if(x z) { int t = x。 x = z。 z = t。 } if(y z) { int t = y。 y = z。 z = t。 } ( 三個(gè)數(shù)字由小到大排列為: +x + + y + + z)。}}class input{public int input() { int value = 0。 Scanner s = new Scanner()。 value = ()。 return value。}} 【程序16】題目:輸出9*9口訣。public class lianxi16 {public static void main(String[] args) { for(int i=1。 i10。 i++) { for(int j=1。 j=i。 j++) { (j + * + i + = + j*i + )。 if(j*i10){( )。}} ()。 }}} 【程序17】題目:猴子吃桃問題:猴子第一天摘下若干個(gè)桃子,當(dāng)即吃了一半,還不癮,又多吃了一個(gè) 第二天早上又將剩下的桃子吃掉一半,又多吃了一個(gè)。以后每天早上都吃了前一天剩下 的一半零一個(gè)。到第10天早上想再吃時(shí),見只剩下一個(gè)桃子了。求第一天共摘了多少。public class lianxi17 {public static void main(String[] args) { int x = 1。 for(int i=2。 i=10。 i++) { x = (x+1)*2。 } (猴子第一天摘了 + x + 個(gè)桃子)。}}【程序18】題目:兩個(gè)乒乓球隊(duì)進(jìn)行比賽,各出三人。甲隊(duì)為a,b,c三人,乙隊(duì)為x,y,z三人。已抽簽決定比賽名單。有人向隊(duì)員打聽比賽的名單。a說他不和x比,c說他不和x,z比,請編程序找出三隊(duì)賽手的名單。public class lianxi18 {static char[] m = { 39。a39。, 39。b39。, 39。c39。 }。static char[] n = { 39。x39。, 39。y39。, 39。z39。 }。public static void main(String[] args) { for (int i = 0。 i 。 i++) { for (int j = 0。 j 。 j++) { if (m[i] == 39。a39。 amp。amp。 n[j] == 39。x39。) { continue。} else if (m[i] == 39。a39。 amp。amp。 n[j] == 39。y39。) { continue。 } else if ((m[i] == 39。c39。 amp。amp。 n[j] == 39。x39。) || (m[i] == 39。c39。 amp。amp。 n[j] == 39。z39。)) { continue。 } else if ((m[i] == 39。b39。 amp。amp。 n[j] == 39。z39。) || (m[i] == 39。b39。 amp。amp。 n[j] == 39。y39。)) { continue。 } else (m[i] + vs + n[j])。 } }}}【程序19】題目:打印出如下圖案(菱形) * *** ************ ***** *** *public class lianxi19 {public static void main(String[] args) { int H = 7, W = 7。//高和寬必須是相等的奇數(shù) for(int i=0。 i(H+1) / 2。 i++) { for(int j=0。 jW/2i。 j++) { ( )。 } for(int k=1。 k(i+1)*2。 k++) { (39。*39。)。 } ()。 } for(int i=1。 i=H/2。 i++) { for(int j=1。 j=i。 j++) { ( )。 } for(int k=1。 k=W2*i。 k++) { (39。*39。)。 } ()。 }}}【程序20】題目:有一分?jǐn)?shù)序列:2/1,3/2,5/3,8/5,13/8,21/13...求出這個(gè)數(shù)列的前20項(xiàng)之和。public class lianxi20 {public static void main(String[] args) { int x = 2, y = 1, t。 double sum = 0。 for(int i=1。 i=20。 i++) { sum = sum + (double)x / y。 t = y。 y = x。 x = y + t。 }(前20項(xiàng)相加之和是: + sum)。}}【程序21】題目:求1+2!+3!+...+20!的和16
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦

高一數(shù)學(xué)選擇題50題含答案-資料下載頁

【總結(jié)】1.已知集合M{4,7,8},且M中至多有一個(gè)偶數(shù),則這樣的集合共有()