-
09-16-2013, 07:00 AM #51Junior Member
- Ngày tham gia
- Jul 2014
- Bài viết
- 0
nộp bài
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:/* * to change this template, choose tools | templates * and open the template in the editor. */ package bai7.pkg1; import java.util.scanner; /** * * @author superman */ public class bai71 { /** * @param args the command line arguments */ public static void main(string[] args) { int tuoi; string ten; float toan, ly, hoa, trb; scanner hs = new scanner(system.in); system.out.println("nhập tên: "); ten = hs.nextline(); system.out.println("nhập tuổi"); tuoi = hs.nextint(); if (tuoi < 1){ system.out.println("bạn đã nhập sai tuổi");} system.out.println("nhập điểm toán: "); toan = hs.nextfloat(); system.out.println("nhập điểm lý: "); ly = hs.nextfloat(); system.out.println("nhập điểm hóa: "); hoa = hs.nextfloat(); if (toan < 0 || ly < 0 || hoa < 0 || toan > 10 || ly > 10 || hoa > 10){ system.out.println("bạn đã nhập sai điểm"); }else{ trb = ( toan + ly + hoa)/3; if (trb >= 0 && trb < 3.5){ system.out.println("học sinh "+ten+" là học sinh kém");} if (trb >= 3.5 && trb < 5){ system.out.println("học sinh "+ten+" là học sinh yếu");} if (trb >= 5 && trb < 6.5){ system.out.println("học sinh "+ten+" là học sinh trung bình");} if (trb >= 6.5 && trb < 8){ system.out.println("học sinh "+ten+" là học sinh khá");} if (trb >= 8){ system.out.println("học sinh "+ten+" là học sinh giỏi");} } // todo code application logic here } }
</div>
</div>
-
09-16-2013, 07:00 AM #52Junior Member
- Ngày tham gia
- Nov 2014
- Bài viết
- 0
nộp bài
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:/* * to change this template, choose tools | templates * and open the template in the editor. */ package bai7.pkg1; import java.util.scanner; /** * * @author superman */ public class bai71 { /** * @param args the command line arguments */ public static void main(string[] args) { int tuoi; string ten; float toan, ly, hoa, trb; scanner hs = new scanner(system.in); system.out.println("nhập tên: "); ten = hs.nextline(); system.out.println("nhập tuổi"); tuoi = hs.nextint(); if (tuoi < 1){ system.out.println("bạn đã nhập sai tuổi");} system.out.println("nhập điểm toán: "); toan = hs.nextfloat(); system.out.println("nhập điểm lý: "); ly = hs.nextfloat(); system.out.println("nhập điểm hóa: "); hoa = hs.nextfloat(); if (toan < 0 || ly < 0 || hoa < 0 || toan > 10 || ly > 10 || hoa > 10){ system.out.println("bạn đã nhập sai điểm"); }else{ trb = ( toan + ly + hoa)/3; if (trb >= 0 && trb < 3.5){ system.out.println("học sinh "+ten+" là học sinh kém");} if (trb >= 3.5 && trb < 5){ system.out.println("học sinh "+ten+" là học sinh yếu");} if (trb >= 5 && trb < 6.5){ system.out.println("học sinh "+ten+" là học sinh trung bình");} if (trb >= 6.5 && trb < 8){ system.out.println("học sinh "+ten+" là học sinh khá");} if (trb >= 8){ system.out.println("học sinh "+ten+" là học sinh giỏi");} } // todo code application logic here } }
</div>
</div>
-
09-25-2013, 07:00 AM #53Junior Member
- Ngày tham gia
- Jul 2014
- Bài viết
- 0
mình vẫn chưa hiểu lệnh next.int và next.line khác nhau chỗ nào và được thực thi khi nào, vd mình có đoạn chương trình sau
Mã nguồn PHP:[color=#000000]
scanner keyboard [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"enter your age."[/color][color=#007700]);[/color][color=#0000bb]int age [/color][color=#007700]= [/color][color=#0000bb]keyboard[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]();[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"enter your name."[/color][color=#007700]);[/color][color=#0000bb]string name [/color][color=#007700]= [/color][color=#0000bb]keyboard[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]();[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]name [/color][color=#007700]+ [/color][color=#dd0000]",you are " [/color][color=#007700]+ [/color][color=#0000bb]age [/color][color=#007700]+ [/color][color=#dd0000]" years old."[/color][color=#007700]);[/color]
-
09-26-2013, 07:00 AM #54Junior Member
- Ngày tham gia
- Mar 2014
- Bài viết
- 0
Gửi bởi kz9x
-
09-26-2013, 07:00 AM #55Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
Gửi bởi tiasangmoi92
Mã nguồn PHP:[color=#000000]
enter your age[/color][color=#007700].[/color]
Mã nguồn PHP:[color=#000000]
enter your name[/color][color=#007700].[/color]
-
09-26-2013, 07:00 AM #56Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
Gửi bởi kz9x
Mã nguồn PHP:[color=#000000]
scanner keyboard [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"enter your age."[/color][color=#007700]); [/color][color=#0000bb]int age [/color][color=#007700]= [/color][color=#0000bb]keyboard[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"enter your name."[/color][color=#007700]); [/color][color=#0000bb]keyboard[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#ff8000]//nhận ký tự enter ở phía trên, tránh bị trượt khi nhập ở dưới! [/color][color=#0000bb]string name [/color][color=#007700]= [/color][color=#0000bb]keyboard[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]name [/color][color=#007700]+ [/color][color=#dd0000]",you are " [/color][color=#007700]+ [/color][color=#0000bb]age [/color][color=#007700]+ [/color][color=#dd0000]" years old."[/color][color=#007700]);[/color]
-
09-26-2013, 07:00 AM #57Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 20
Gửi bởi tiasangmoi92
nghĩa là sao nhỉ, mình chưa hiểu lắm
-
09-27-2013, 07:00 AM #58Junior Member
- Ngày tham gia
- Apr 2014
- Bài viết
- 0
Gửi bởi kimcy929
Gửi bởi kimcy929
-
10-05-2013, 07:00 AM #59Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]sinhvien[/color][color=#007700]{private [/color][color=#0000bb]string hoten[/color][color=#007700];private [/color][color=#0000bb]int namsinh[/color][color=#007700];private [/color][color=#0000bb]float toan[/color][color=#007700], [/color][color=#0000bb]ly[/color][color=#007700], [/color][color=#0000bb]hoa[/color][color=#007700];public [/color][color=#0000bb]void nhap[/color][color=#007700](){[/color][color=#0000bb]scanner s[/color][color=#007700]=new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập họ tên: "[/color][color=#007700]);[/color][color=#0000bb]hoten[/color][color=#007700]=[/color][color=#0000bb]s[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]();do{[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập năm sinh: "[/color][color=#007700]);[/color][color=#0000bb]namsinh[/color][color=#007700]=[/color][color=#0000bb]s[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700]();}while([/color][color=#0000bb]nam[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]);do{[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm toán, lý , hóa: "[/color][color=#007700]);[/color][color=#0000bb]toan[/color][color=#007700]=[/color][color=#0000bb]s[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]();[/color][color=#0000bb]ly[/color][color=#007700]=[/color][color=#0000bb]s[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]();[/color][color=#0000bb]hoa[/color][color=#007700]=[/color][color=#0000bb]s[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700]();}while([/color][color=#0000bb]toan[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]toan[/color][color=#007700]>[/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]ly[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]ly[/color][color=#007700]>[/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]hoa[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]hoa[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700]);}public [/color][color=#0000bb]float diemtrungbinh[/color][color=#007700](){return ([/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#0000bb]ly[/color][color=#007700]+[/color][color=#0000bb]hoa[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700];}public [/color][color=#0000bb]void [/color][color=#007700]print(){[/color][color=#0000bb]float dtb[/color][color=#007700]=[/color][color=#0000bb]diemtrungbinh[/color][color=#007700]();if([/color][color=#0000bb]dtb[/color][color=#007700]>=[/color][color=#0000bb]8.0[/color][color=#007700])[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"học sinh giỏi"[/color][color=#007700]);else if([/color][color=#0000bb]dtb[/color][color=#007700]>=[/color][color=#0000bb]6.5[/color][color=#007700])[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]pritnln[/color][color=#007700]([/color][color=#dd0000]"học sinh khá"[/color][color=#007700]);else if([/color][color=#0000bb]dtb[/color][color=#007700]>[/color][color=#0000bb]5.0[/color][color=#007700])[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"học sinh trung bình"[/color][color=#007700]);else [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"học sinh yếu"[/color][color=#007700]);}public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][][/color][color=#0000bb]args[/color][color=#007700]){[/color][color=#0000bb]sinhvien s[/color][color=#007700]=new [/color][color=#0000bb]sinhvien[/color][color=#007700]();[/color][color=#0000bb]s[/color][color=#007700].[/color][color=#0000bb]nhap[/color][color=#007700]();[/color][color=#0000bb]s[/color][color=#007700].print();}}[/color]
-
10-08-2013, 07:00 AM #60Junior Member
- Ngày tham gia
- Dec 2014
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner [/color][color=#007700];public class [/color][color=#0000bb]diemtrungbinh [/color][color=#007700]{ public static [/color][color=#0000bb]void main [/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]string ten[/color][color=#007700]; [/color][color=#0000bb]int tuoi[/color][color=#007700]; [/color][color=#0000bb]float toan[/color][color=#007700],[/color][color=#0000bb]ly[/color][color=#007700],[/color][color=#0000bb]hoa[/color][color=#007700],[/color][color=#0000bb]tbc[/color][color=#007700]; [/color][color=#0000bb]scanner nhapdulieu [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print ([/color][color=#dd0000]"nhap ho va ten : "[/color][color=#007700]); [/color][color=#0000bb]ten[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); do { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap tuoi : "[/color][color=#007700]); [/color][color=#0000bb]tuoi[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); if([/color][color=#0000bb]tuoi[/color][color=#007700]<[/color][color=#0000bb]1[/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"nhap sai nhap lai"[/color][color=#007700]);} while ([/color][color=#0000bb]tuoi[/color][color=#007700]<[/color][color=#0000bb]1[/color][color=#007700]); do{ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap diem mon toan: "[/color][color=#007700]); [/color][color=#0000bb]toan[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if([/color][color=#0000bb]toan[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]||[/color][color=#0000bb]toan[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700])[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"nhap sai nhap lai"[/color][color=#007700]);} while([/color][color=#0000bb]toan[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]||[/color][color=#0000bb]toan[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700]); do{ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"nhap diem mon ly "[/color][color=#007700]); [/color][color=#0000bb]ly[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if([/color][color=#0000bb]ly[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]||[/color][color=#0000bb]ly[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"nhap sai nhap lai"[/color][color=#007700]);} while([/color][color=#0000bb]ly[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]||[/color][color=#0000bb]ly[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700]); do{ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap diem mon hoa: "[/color][color=#007700]); [/color][color=#0000bb]hoa[/color][color=#007700]=[/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if([/color][color=#0000bb]hoa[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]||[/color][color=#0000bb]hoa[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"nhap sai nhap lai "[/color][color=#007700]);} while([/color][color=#0000bb]hoa[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]||[/color][color=#0000bb]hoa[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700]); [/color][color=#0000bb]tbc[/color][color=#007700]=([/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#0000bb]ly[/color][color=#007700]+[/color][color=#0000bb]hoa[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem trung binh : "[/color][color=#007700]+[/color][color=#0000bb]tbc[/color][color=#007700]+[/color][color=#dd0000]"
"[/color][color=#007700]); if([/color][color=#0000bb]tbc[/color][color=#007700]>[/color][color=#0000bb]8[/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"xep loai gioi"[/color][color=#007700]); else if([/color][color=#0000bb]tbc[/color][color=#007700]>[/color][color=#0000bb]6.5[/color][color=#007700]) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"xep loai kha"[/color][color=#007700]); else if([/color][color=#0000bb]tbc[/color][color=#007700]>[/color][color=#0000bb]5[/color][color=#007700])[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"xep loai trung binh"[/color][color=#007700]); else [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println [/color][color=#007700]([/color][color=#dd0000]"xep loai yeu"[/color][color=#007700]); }}[/color]
</div>
</div>
Khu dự án Diamond Alnata Plus phát triển bởi Gamuda Land thiết kế hợp lý nằm trung tâm thông gió tự nhiên. Diamond Alnata Plus Tân Phú thiết kế hợp lý sống đích thực ngay giữa trung tâm. Căn hộ cách...
Khu dự án Diamond Alnata Plus giáp trung tâm