-
02-03-2015, 07:00 AM #41Junior Member
- Ngày tham gia
- Mar 2015
- Bài viết
- 0
package classdemo;
/**
*
* @author quanghuy
*/
import java.util.scanner;
class sinhvien {
public string hoten;
public string lop;
public double tb;
}
public class classdemo {
/**
* @param args the command line arguments
*/
public static void main(string[] args) {
// todo code application logic here
scanner input = new scanner(system.in);
sinhvien a = new sinhvien();
sinhvien b = new sinhvien();
system.out.println("nhap ho ten sinh vien a: ");
a.hoten = input.nextline();
system.out.println("nhap ho ten sinh vien b: ");
b.hoten = input.nextline();
system.out.println("nhap lop: ");
a.lop = input.nextline();
system.out.println("nhap lop: ");
b.lop = input.nextline();
system.out.println("nhap diem trung binh sinh vien a: ");
a.tb = input.nextdouble();
system.out.println("nhap diem trung binh sinh vien b: ");
b.tb = input.nextdouble();
if (a.tb > b.tb) {
system.out.println("diem trung binh sinh vien " + a.hoten + " cao hon sinh vien " + b.hoten);
} else if (a.tb == b.tb) {
system.out.println("diem trung binh hai sinh vien bang nhau");
} else {
system.out.println("diem trung binh sinh vien " + b.hoten + " cao hon sinh vien " + a.hoten);
}
}
}
-
02-03-2015, 07:00 AM #42Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
Gửi bởi huynq
-
03-09-2015, 07:00 AM #43Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
[/color][color=#007700]class [/color][color=#0000bb]sinhvien [/color][color=#007700]{ public [/color][color=#0000bb]string hoten[/color][color=#007700]; public [/color][color=#0000bb]string lop[/color][color=#007700]; public [/color][color=#0000bb]int diemtb[/color][color=#007700];} public class [/color][color=#0000bb]demo [/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]scanner sc [/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]sinhvien sv1 [/color][color=#007700]= new [/color][color=#0000bb]sinhvien[/color][color=#007700](); [/color][color=#0000bb]sinhvien sv2 [/color][color=#007700]= new [/color][color=#0000bb]sinhvien[/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 ten sinh vien thu nhat"[/color][color=#007700]); [/color][color=#0000bb]sv1[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]sc[/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=#dd0000]"nhap lop sinh vien thu nhat"[/color][color=#007700]); [/color][color=#0000bb]sv1[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]sc[/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=#dd0000]"nhap diem trung binh sinh vien thu nhat"[/color][color=#007700]); [/color][color=#0000bb]sv1[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]sc[/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]"nhap ten sinh vien thu hai"[/color][color=#007700]); [/color][color=#0000bb]sv2[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]sc[/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=#dd0000]"nhap lop sinh vien thu hai"[/color][color=#007700]); [/color][color=#0000bb]sv2[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]sc[/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=#dd0000]"nhap diem trung binh sinh vien thu hai"[/color][color=#007700]); [/color][color=#0000bb]sv2[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); if([/color][color=#0000bb]sv2[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]> [/color][color=#0000bb]sv1[/color][color=#007700].[/color][color=#0000bb]diemtb[/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]"diem trung binh cua sv2 lon hon sv1"[/color][color=#007700]); } else if([/color][color=#0000bb]sv2[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]== [/color][color=#0000bb]sv1[/color][color=#007700].[/color][color=#0000bb]diemtb[/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]"diem trung binh cua sv1 bang nhau sv2"[/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]"diem trung binh cua sv1 long hon sv2"[/color][color=#007700]); } }}[/color]
-
03-10-2015, 07:00 AM #44Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>sao vậy nhỉ? (move your mouse to reveal the content)</noscript>
sao vậy nhỉ? (open)
sao vậy nhỉ? (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]inputstream[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];class [/color][color=#0000bb]sinhvien [/color][color=#007700]{public [/color][color=#0000bb]string hoten[/color][color=#007700];public [/color][color=#0000bb]int namsinh[/color][color=#007700];public [/color][color=#0000bb]string lophoc[/color][color=#007700];public [/color][color=#0000bb]double diemtb[/color][color=#007700];}public class [/color][color=#0000bb]main [/color][color=#007700]{public [/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]scanner nhapdl [/color][color=#007700]= [/color][color=#0000bb]fyaz[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]);[/color][color=#0000bb]sinhvien a [/color][color=#007700]= new [/color][color=#0000bb]sinhvien[/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 ten a "[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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=#dd0000]"nhap nam sinh a"[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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]"nhap lop a"[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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=#dd0000]"nhap diem a"[/color][color=#007700]);[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700](); [/color][color=#0000bb]sinhvien b [/color][color=#007700]= new [/color][color=#0000bb]sinhvien[/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 ten b "[/color][color=#007700]);[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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=#dd0000]"nhap tuoi b"[/color][color=#007700]);[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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]"nhap lop b"[/color][color=#007700]);[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/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=#dd0000]"diem b"[/color][color=#007700]);[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]nhapdl[/color][color=#007700].[/color][color=#0000bb]nextdouble[/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]"nguoi co diem cao hon la : "[/color][color=#007700]);if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]> [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]diemtb[/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]"ten : " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]+ [/color][color=#dd0000]"
nam sinh = " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]namsinh[/color][color=#007700]+ [/color][color=#dd0000]"
lop : " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]+ [/color][color=#dd0000]"
diem : " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]diemtb[/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]"ten : " [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]hoten [/color][color=#007700]+ [/color][color=#dd0000]"
nam sinh = " [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]namsinh[/color][color=#007700]+ [/color][color=#dd0000]"
lop : " [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]lophoc [/color][color=#007700]+ [/color][color=#dd0000]"
diem : " [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]diemtb[/color][color=#007700]);}private [/color][color=#0000bb]scanner fyaz[/color][color=#007700]([/color][color=#0000bb]inputstream in[/color][color=#007700]) {[/color][color=#ff8000]// todo auto-generated method stub[/color][color=#007700]return [/color][color=#0000bb]null[/color][color=#007700];} }[/color]
</div>
</div>
sao mình run bằng eclipse k được , nó chỉ hiển thị "error: could not find or load main class "
-
04-19-2015, 07:00 AM #45Junior Member
- Ngày tham gia
- Jan 2016
- Bài viết
- 13
Mã nguồn PHP:[color=#000000]
package hocsinh[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]hocsinh [/color][color=#007700]{ [/color][color=#0000bb]scanner nhap [/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]); private [/color][color=#0000bb]string name[/color][color=#007700]; private [/color][color=#0000bb]string lop[/color][color=#007700]; private [/color][color=#0000bb]float diemtb[/color][color=#007700]; public [/color][color=#0000bb]string getname[/color][color=#007700](){ return [/color][color=#0000bb]name[/color][color=#007700]; } public [/color][color=#0000bb]void setname [/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 ten : "[/color][color=#007700]); [/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; } public [/color][color=#0000bb]string getlop[/color][color=#007700](){ return [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]void setlop [/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 lop : "[/color][color=#007700]); [/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]float getdiemtb[/color][color=#007700](){ return [/color][color=#0000bb]diemtb[/color][color=#007700]; } public [/color][color=#0000bb]void setdiemtb [/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 diem : "[/color][color=#007700]); [/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]diemtb[/color][color=#007700]; } public [/color][color=#0000bb]void show [/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]"ten : "[/color][color=#007700]+[/color][color=#0000bb]name [/color][color=#007700]+ [/color][color=#dd0000]"lop : "[/color][color=#007700]+[/color][color=#0000bb]lop [/color][color=#007700]+ [/color][color=#dd0000]"diem tb :" [/color][color=#007700]+[/color][color=#0000bb]diemtb [/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]hocsinh a [/color][color=#007700]= new [/color][color=#0000bb]hocsinh[/color][color=#007700](); [/color][color=#0000bb]hocsinh b [/color][color=#007700]= new [/color][color=#0000bb]hocsinh[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setname[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setlop[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setdiemtb[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setname[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setlop[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setdiemtb[/color][color=#007700](); if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]() > [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]()){ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]show[/color][color=#007700](); } else if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]() < [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]()) [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]show[/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]"bang nhau"[/color][color=#007700]); } }[/color]
-
04-19-2015, 07:00 AM #46Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>ai coi giúp em tại sao khi chạy ct nhập số thực lại bị lỗi ạ (move your mouse to reveal the content)</noscript>
ai coi giúp em tại sao khi chạy ct nhập số thực lại bị lỗi ạ (open)
ai coi giúp em tại sao khi chạy ct nhập số thực lại bị lỗi ạ (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote></blockquote></div>
</div>
</div>
<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]
package hocsinh[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]hocsinh [/color][color=#007700]{ [/color][color=#0000bb]scanner nhap [/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]); private [/color][color=#0000bb]string name[/color][color=#007700]; private [/color][color=#0000bb]string lop[/color][color=#007700]; private [/color][color=#0000bb]float diemtb[/color][color=#007700]; public [/color][color=#0000bb]string getname[/color][color=#007700](){ return [/color][color=#0000bb]name[/color][color=#007700]; } public [/color][color=#0000bb]void setname [/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 ten : "[/color][color=#007700]); [/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]name[/color][color=#007700]; } public [/color][color=#0000bb]string getlop[/color][color=#007700](){ return [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]void setlop [/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 lop : "[/color][color=#007700]); [/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]lop [/color][color=#007700]= [/color][color=#0000bb]lop[/color][color=#007700]; } public [/color][color=#0000bb]float getdiemtb[/color][color=#007700](){ return [/color][color=#0000bb]diemtb[/color][color=#007700]; } public [/color][color=#0000bb]void setdiemtb [/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 diem : "[/color][color=#007700]); [/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]this[/color][color=#007700].[/color][color=#0000bb]diemtb [/color][color=#007700]= [/color][color=#0000bb]diemtb[/color][color=#007700]; } public [/color][color=#0000bb]void show [/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]"ten : "[/color][color=#007700]+[/color][color=#0000bb]name [/color][color=#007700]+ [/color][color=#dd0000]"lop : "[/color][color=#007700]+[/color][color=#0000bb]lop [/color][color=#007700]+ [/color][color=#dd0000]"diem tb :" [/color][color=#007700]+[/color][color=#0000bb]diemtb [/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]hocsinh a [/color][color=#007700]= new [/color][color=#0000bb]hocsinh[/color][color=#007700](); [/color][color=#0000bb]hocsinh b [/color][color=#007700]= new [/color][color=#0000bb]hocsinh[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setname[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setlop[/color][color=#007700](); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]setdiemtb[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setname[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setlop[/color][color=#007700](); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]setdiemtb[/color][color=#007700](); if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]() > [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]()){ [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]show[/color][color=#007700](); } else if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]() < [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]getdiemtb[/color][color=#007700]()) [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]show[/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]"bang nhau"[/color][color=#007700]); } }[/color]
</div>
</div>
-
01-22-2016, 07:00 AM #47Junior Member
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
Gửi bởi xvirion
-
05-18-2016, 07:00 AM #48Junior Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 5
Gửi bởi vjrus.ht
-
05-27-2016, 07:00 AM #49Junior Member
- Ngày tham gia
- Mar 2014
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
package javacoban[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];class [/color][color=#0000bb]hocsinh[/color][color=#007700]{public [/color][color=#0000bb]string ten[/color][color=#007700];public [/color][color=#0000bb]string lh[/color][color=#007700];public [/color][color=#0000bb]double dtb[/color][color=#007700];}public class [/color][color=#0000bb]class_1 [/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]hocsinh a[/color][color=#007700]=new [/color][color=#0000bb]hocsinh[/color][color=#007700]();[/color][color=#0000bb]hocsinh b[/color][color=#007700]=new [/color][color=#0000bb]hocsinh[/color][color=#007700]();[/color][color=#0000bb]scanner inp[/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]"nhap ten hoc sinh a"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]ten[/color][color=#007700]=[/color][color=#0000bb]inp[/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=#dd0000]"nhap lop hoc sinh a"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]lh[/color][color=#007700]=[/color][color=#0000bb]inp[/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=#dd0000]"nhap diem trung binh cua hoc sinh a"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]dtb[/color][color=#007700]=[/color][color=#0000bb]inp[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700]();[/color][color=#0000bb]inp[/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=#dd0000]"nhap ten hoc sinh b"[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]ten[/color][color=#007700]=[/color][color=#0000bb]inp[/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=#dd0000]"nhap lop hoc sinh b"[/color][color=#007700]);[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]lh[/color][color=#007700]=[/color][color=#0000bb]inp[/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=#dd0000]"nhap diem trung binh cua hoc sinh b"[/color][color=#007700]); [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]dtb[/color][color=#007700]=[/color][color=#0000bb]inp[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700]();if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]dtb[/color][color=#007700]>[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]dtb[/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]"hoc sinh "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]ten[/color][color=#007700]+[/color][color=#dd0000]" lop "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]lh[/color][color=#007700]+[/color][color=#dd0000]" hoc gioi hon"[/color][color=#007700]);} else { if ([/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]dtb[/color][color=#007700]<[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]dtb[/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]"hoc sinh "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]ten[/color][color=#007700]+[/color][color=#dd0000]" lop "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]lh[/color][color=#007700]+[/color][color=#dd0000]" hoc gioi hon"[/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]"2 hoc sinh gioi bang nhau"[/color][color=#007700]); } }}}[/color]
<div class="attribution type"><noscript>bai (move your mouse to reveal the content)</noscript>
bai (open)
bai (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote></blockquote></div>
</div>
</div>
"căn do xuất tinh ngược này do lượng đường cao dẫn tới thương tổn dây thần kinh tại các cơ vòng khiến người bệnh bị xuất tinh ngược. thường ngày, khi xuất tinh thì cơ thắt cổ bọng đái đóng lại để...
Nguyên nhân và giải pháp cho tình trạng không xuất tinh ở phái mạnh?