public class Lucky {
創(chuàng)新互聯(lián)公司自成立以來,一直致力于為企業(yè)提供從網(wǎng)站策劃、網(wǎng)站設(shè)計(jì)、成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、電子商務(wù)、網(wǎng)站推廣、網(wǎng)站優(yōu)化到為企業(yè)提供個(gè)性化軟件開發(fā)等基于互聯(lián)網(wǎng)的全面整合營(yíng)銷服務(wù)。公司擁有豐富的網(wǎng)站建設(shè)和互聯(lián)網(wǎng)應(yīng)用系統(tǒng)開發(fā)管理經(jīng)驗(yàn)、成熟的應(yīng)用系統(tǒng)解決方案、優(yōu)秀的網(wǎng)站開發(fā)工程師團(tuán)隊(duì)及專業(yè)的網(wǎng)站設(shè)計(jì)師團(tuán)隊(duì)。
public static void main(String[] args){
System.out.println("請(qǐng)輸入您的4位會(huì)員卡號(hào):");
Scanner sc = new Scanner(System.in);
int number = sc.nextInt(); //接收用戶從控制臺(tái)輸入的會(huì)員卡號(hào),并保存在會(huì)員卡號(hào)變量中
int a = number/1000; //千位
int b = number%1000/100; //百位
int c = number%100/10; //十位
int d = number%10; //個(gè)位
if((a+b+c+d)20){
System.out.println("恭喜中獎(jiǎng)!您是幸運(yùn)客戶");
}else{
System.out.println("謝謝參與!");
}
}
}
最基礎(chǔ)的 沒有異常判斷 無限循環(huán)輸入什么東西
汗....我用的是java...有些代碼上幫不了你....但我建議別用sql執(zhí)行這樣的操作,尤其是提示,著實(shí)是太難用了,其實(shí)可以通過語句先判斷,然后通過url傳遞判斷結(jié)果的參數(shù),最后借助js判斷結(jié)果參數(shù),并作出提示操作。
classBirth{privateStringbirth;privateStringsname;privateStringinterest;privateStringbook;privateStringfilm;publicvoidsetBirth(Stringbirth){this.birth=birth;}publicvoidsetName(Stringsname){this.sname=sname;}publicvoidsetInterest(Stringinterest){this.interest=interest;}publicvoidsetBook(Stringbook){this.book=book;}publicvoidsetFilm(Stringfilm){this.film=film;}publicStringgetBirth(){returnbirth;}publicStringgetName(){returnsname;}publicStringgetInterest(){returninterest;}publicStringgetBook(){returnbook;}publicStringgetFilm(){returnfilm;}publicvoidoutPut(){System.out.println("YourNameis:"+this.getName());System.out.println("YourBirthis:"+this.getBirth());System.out.println("YourInterestis:"+this.getInterest());System.out.println("YourBookis:"+this.getBook());System.out.println("Yourfilmis:"+this.getFilm());}}publicclassTestBirth{publicstaticvoidmain(String[]args){Birthbr=newBirth();br.setName("xuwenpeng");br.setBirth("1987/03/04");br.setInterest("basketball");br.setFilm("aidefengxiang");br.setBook("java");br.outPut();}}Result:YourNameis:xuwenpengYourBirthis:1987/03/04YourInterestis:basketballYourBookis:javaYourfilmis:aidefengxiang
public class TestInput {
public static void main(String[] args) {
int point = Integer.parseInt(args[0]);
point -= 2000;
System.out.println(point / 300);
}
}
運(yùn)行時(shí)要加參數(shù),命令行:javac TestInput.java 然后 java TestInput 2500
如果是用eclipse:run configurations - arguments - 2500
本文題目:java刷禮物代碼 刷禮物代碼
網(wǎng)頁(yè)路徑:http://chinadenli.net/article28/hgdejp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、標(biāo)簽優(yōu)化、網(wǎng)站設(shè)計(jì)、定制開發(fā)、App設(shè)計(jì)、企業(yè)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)