-
02-23-2014, 07:00 AM #91Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 41
bài 1: <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ã:public class newclass1 { public static void main(string[] args) { int a, b, c, nguyena, nguyenb, nguyenc, dua, dub, duc; a=3; b=4; c=5; nguyena=a/2; nguyenb=b/2; nguyenc=c/2; dua=a%2; dub=b%2; duc=c%2; system.out.println("phan nguyen cua a:"+nguyena); system.out.println("phan nguyen cua b:"+nguyenb); system.out.println("phan nguyen cua c:"+nguyenc); system.out.println("phan du cua a:"+dua); system.out.println("phan du cua b:"+dub); system.out.println("phan du cua c:"+duc); a++; b++; c++; system.out.println("gia tri cua a tang len 1:"+a); system.out.println("gia tri cua b tang len 1:"+b); system.out.println("gia tri cua c tang len 1:"+c); } }
</div>
</div>
bài 2: <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ã:public class newclass { public static void main(string[] args) { float a, b, c, x; int songuyen; a=1f; b=2f; c=3f; x=(8*c-b)/2*a; system.out.println("gia tri cua x la:"+x); songuyen=(int)x; system.out.println("so thuc ep thanh so nguyen:"+songuyen); } }
</div>
</div>
bài 3 mình chưa làm được, mình không rõ sử dụng công thức java
sr m dân ngoại đạo!
-
02-23-2014, 07:00 AM #92Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
bai 3 minh co tham khoa cac ban cac ham va da lam ra: <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ã:public class student { public static void main(string[] args) { float a=2; float b=3; float c=4; float p; float s; p=(float)(a+b+c)/2; s= (float) math.sqrt(p*(p-a)*(p-b)*(p-c)); system.out.println("phan tinh dien tich tam giac"); system.out.println("dien tich:"+s); double goca= math.asin(s/(0.5*b*c)); double gocb= math.asin(s/(0.5*c*a)); double gocc= math.asin(s/(0.5*a*b)); system.out.println("phan tinh goc"); system.out.println("so do goc a la:"+math.todegrees(goca)); system.out.println("so do goc a la:"+math.todegrees(gocb)); system.out.println("so do goc a la:"+math.todegrees(gocc)); } }
</div>
</div>
-
02-25-2014, 07:00 AM #93Banned
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
bài 1:
<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]
[/color][color=#007700]public class [/color][color=#0000bb]javabai4 [/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]int a [/color][color=#007700]= [/color][color=#0000bb]12 [/color][color=#007700], [/color][color=#0000bb]b [/color][color=#007700]=[/color][color=#0000bb]24 [/color][color=#007700], [/color][color=#0000bb]c [/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]"nguyen chia cho 2: "[/color][color=#007700]+[/color][color=#dd0000]" a="[/color][color=#007700]+([/color][color=#0000bb]a[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700])+[/color][color=#dd0000]" ;b="[/color][color=#007700]+([/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700])+[/color][color=#dd0000]" ;c="[/color][color=#007700]+([/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]2[/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]"nguyen du cho 3: "[/color][color=#007700]+[/color][color=#dd0000]" a="[/color][color=#007700]+([/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700])+[/color][color=#dd0000]" ;b="[/color][color=#007700]+([/color][color=#0000bb]b[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700])+[/color][color=#dd0000]" ;c="[/color][color=#007700]+([/color][color=#0000bb]c[/color][color=#007700]%[/color][color=#0000bb]3[/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]"tang bien: "[/color][color=#007700]+[/color][color=#dd0000]" a="[/color][color=#007700]+(++[/color][color=#0000bb]a[/color][color=#007700])+[/color][color=#dd0000]" ;b="[/color][color=#007700]+(++[/color][color=#0000bb]b[/color][color=#007700])+[/color][color=#dd0000]" ;c="[/color][color=#007700]+(++[/color][color=#0000bb]c[/color][color=#007700]));[/color]
</div>
</div>
-
02-25-2014, 07:00 AM #94Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
bai 2:
<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]
[/color][color=#007700]public class [/color][color=#0000bb]javabai4 [/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]float a [/color][color=#007700]= [/color][color=#0000bb]2.5f [/color][color=#007700], [/color][color=#0000bb]b [/color][color=#007700]=[/color][color=#0000bb]4f [/color][color=#007700], [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]6.5f [/color][color=#007700], [/color][color=#0000bb]x[/color][color=#007700]= ([/color][color=#0000bb]8[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]-[/color][color=#0000bb]b[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]); if([/color][color=#0000bb]a[/color][color=#007700]!=[/color][color=#0000bb]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]"giai phuong trinh: x="[/color][color=#007700]+ [/color][color=#0000bb]x[/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]"giai phuong trinh ep kieu: x="[/color][color=#007700]+ (int)[/color][color=#0000bb]x[/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]"bien a phai khac 0"[/color][color=#007700]);} } }[/color]
</div>
</div>
-
02-25-2014, 07:00 AM #95Junior Member
- Ngày tham gia
- Mar 2015
- Bài viết
- 0
bai 3
<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]
[/color][color=#007700]public class [/color][color=#0000bb]javabai4 [/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]float a [/color][color=#007700]=[/color][color=#0000bb]3[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]4[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]5[/color][color=#007700], [/color][color=#0000bb]p[/color][color=#007700]=([/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700], [/color][color=#0000bb]s [/color][color=#007700]=(float)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]p[/color][color=#007700]*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]a[/color][color=#007700])*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]b[/color][color=#007700])*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]c[/color][color=#007700])); [/color][color=#0000bb]double cos_a[/color][color=#007700]= (float) ([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]-[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]), [/color][color=#0000bb]cos_b[/color][color=#007700]=([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]-[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]), [/color][color=#0000bb]cos_c[/color][color=#007700]=([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]-[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]b[/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]"diện tích của tam giác: "[/color][color=#007700]+ [/color][color=#0000bb]s[/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]"cos_a="[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees [/color][color=#007700]([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]cos_a[/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]"cos_b="[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees [/color][color=#007700]([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]cos_b[/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]"cos_c="[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees [/color][color=#007700]([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]cos_c[/color][color=#007700]))); }}[/color]
</div>
</div>
-
02-28-2014, 07:00 AM #96Junior Member
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
bài 2
<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></blockquote></div>
</div>
</div>
Mã:/** public class vidu1 { /** * @param args the command line arguments */ public static void main(string[] args) { float a =2.3f; float b =4.8f; float c =5.12f; float x; x = (8*c-b)/(2*a); int y; system.out.println("x="+x); y = (int) x; system.out.println("ep kieu x ve so nguyen la:"+y); } }
-
03-03-2014, 07:00 AM #97Junior Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 11
<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ã:package javabasic; import java.math.*; public class toantu { public static void main(string[] args) { int a=3; int b= 5; int c=7; system.out.println(" cau 1a"); system.out.println(" phan nguyen khi chia a,b,c "+ "lan luot cho 2 :"+a/2+" ;"+b/2+" ;"+c/2); system.out.println(" phan du khi chia a,b,c "+ "lan luot cho 2 :"+a%2+" ;"+b%2+" ;"+c%2); system.out.println(" cau 1b "); a++; b++; c++; system.out.println(" gia tri cua a, b, c sau" + "khi tang la :"+ a +"; "+b+"; "+c); system.out.println("---------------------"); system.out.println(" cau 2"); float a1= 3.5f; float b1=2f; float c1= 5f; float x= ((8*c1)-b1)/2*a1; int epkieu; system.out.println(" ket qua cua x :"+x); epkieu=(int)x; system.out.println("ket qua sau khi ep kieu la :"+epkieu); system.out.println("---------------------"); system.out.println(" cau 3"); double a2=3.3f; double b2=4f; double c2=5.5f; double p, s; p=(a2+b2+c2)/2; // dien tich tam giac s= math.sqrt(p*(p-a2)*(p-b2)*(p-c2)); system.out.println(" dien tich tam giac la :"+s); // tim goc tam giac double goca= math.acos((b2*b2+c2*c2-a2*a2)/(2*b2*c2)); double gocb= math.acos((a2*a2+c2*c2-b2*b2)/(2*c2*a2)); double gocc= math.acos((b2*b2+a2*a2-c2*c2)/(2*a2*b2)); system.out.println("so do goc a là: " + math.todegrees(goca)); system.out.println("so do goc b là: " + math.todegrees(gocb)); system.out.println("so do goc c là: " + math.todegrees(gocc)); } }
</div>
</div>
-
03-04-2014, 07:00 AM #98Junior Member
- Ngày tham gia
- Mar 2015
- Bài viết
- 0
Mã:package bt1bai4; import java.text.decimalformat; import java.util.scanner; public class chia { public static void main (string[] agrs) { scanner sc=new scanner(system.in); int a,b,c, nguyena, nguyenb, nguyenc, dua,dub,duc; system.out.println("nhap so a:"); a= sc.nextint(); system.out.println("nhap so b:"); b=sc.nextint(); system.out.println("nhap so c:"); c=sc.nextint(); nguyena= a/2; nguyenb=b/2; nguyenc=c/2; system.out.println("phan nguyena (a:2)la :"+ nguyena); system.out.println("phan nguyenb (b:2) la :"+nguyenb); system.out.println("phan nguyenc (c:2) la :"+nguyenc); dua= a%3; dub=b%3; duc=c%3; system.out.println("phan dua (a:3) la: "+dua); system.out.println("phan dub(b:3) la: "+dub); system.out.println("phan duc(c:3) la: "+duc); decimalformat fmt= new decimalformat("0.##"); a++; system.out.println("gia tri a da tang len 1, gia tri moi la: "+ a); b++; system.out.println("gia tri b da tang len 1, gia tri moi la: "+ b); c++; system.out.println("gia tri c da tang len 1, gia tri moi la: "+ c); } } [spoiler][/spoiler]
-
03-09-2014, 07:00 AM #99Junior Member
- Ngày tham gia
- Jul 2014
- Bài viết
- 0
bài 1
<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ã:public class bai_4 { public static void main(string[] args) { int a=5, b=6, c=7; system.out.println("phần nguyên của 5/2: "+ a/2); system.out.println("phần nguyên của 6/2: "+ b/2); system.out.println("phần nguyên của 7/2: "+ c/2); system.out.println("phần dư của 5/3: "+ a%3); system.out.println("phần dư của 6/3: "+ b%3); system.out.println("phần dư của 7/3: "+ c%3); a++; system.out.println("tăng giá trị a thêm 1: "+a); b++; system.out.println("tăng giá trị b thêm 1: "+b); c++; system.out.println("tăng giá trị c thêm 1: "+c); } }
</div>
</div>
bài 2:
<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ã:public class bai_3_2 { public static void main(string[] args) { int a=7, b=4, c=5; float x=(float) (8*c-b)/(2*a); system.out.println("kết quả: "+x); int y=(int) x; system.out.println("kết quả sau khi ép kiểu: "+y); } }
</div>
</div>
bài 3
<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ã:public class bai_3_3 { public static void main(string[] args) { float a=3,b=4,c=5; double chuvi=(a+b+c)/2; double dientich=math.sqrt(chuvi*(chuvi-a)*(chuvi-b)*(chuvi-c)); system.out.println("diện tích tam giác: "+dientich); double a=math.acos((b*b+c*c-a*a)/(2*b*c)); system.out.println("số đo góc a: "+math.todegrees(a)+" độ"); double b=math.acos((a*a+c*c-b*b)/(2*a*c)); system.out.println("số đo góc b: "+math.todegrees(b)+" độ"); double c=math.acos((a*a+b*b-c*c)/(2*a*b)); system.out.println("số đo góc c: "+math.todegrees(c)+" độ"); } }
</div>
</div>
-
03-10-2014, 07:00 AM #100Junior Member
- Ngày tham gia
- Nov 2014
- Đang ở
- Hà Nội
- Bài viết
- 0
bài 1:
<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]
[/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]int a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]5[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]21[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]11[/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]"phần nguyên của a cho 2 là: "[/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700]/[/color][color=#0000bb]2[/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]"phần nguyên của b cho 2 là: "[/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2[/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]"phần nguyên của c cho 2 là: "[/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]2[/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]"phần dư của a cho 3 là: "[/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]3[/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]"phần dư của b cho 3 là: "[/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700]%[/color][color=#0000bb]3[/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]"phần dư của c cho 3 là: "[/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700]++; [/color][color=#0000bb]b[/color][color=#007700]++; [/color][color=#0000bb]c[/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]"các số sau khi được tăng lên 1 đơn vị là:"[/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]"a: "[/color][color=#007700]+ [/color][color=#0000bb]a[/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]"b: "[/color][color=#007700]+ [/color][color=#0000bb]b[/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]"c: "[/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]); } }[/color]
</div>
</div>
bài 2
<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]
[/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]double a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700],[/color][color=#0000bb]x[/color][color=#007700]; [/color][color=#0000bb]int i[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]10[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]0.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]"phương trình đề bài cho là 2ax+b=8c"[/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]"vậy x = (8c-b)/2a"[/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]"kết quả tìm đươc là x= "[/color][color=#007700]+ (([/color][color=#0000bb]8[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])-[/color][color=#0000bb]b[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700])); [/color][color=#0000bb]i [/color][color=#007700]= (int) [/color][color=#0000bb]x[/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]"kết quả sau khi bị ép kiểu x= " [/color][color=#007700]+[/color][color=#0000bb]i[/color][color=#007700]); }}[/color]
</div>
</div>
bài 3
<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]
[/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]double a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700],[/color][color=#0000bb]p[/color][color=#007700],[/color][color=#0000bb]s[/color][color=#007700],[/color][color=#0000bb]cosa[/color][color=#007700],[/color][color=#0000bb]cosb[/color][color=#007700],[/color][color=#0000bb]cosc[/color][color=#007700],[/color][color=#0000bb]a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]3[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]4[/color][color=#007700]; [/color][color=#0000bb]p [/color][color=#007700]= ([/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]s [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]p[/color][color=#007700]*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]a[/color][color=#007700])*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]b[/color][color=#007700])*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]c[/color][color=#007700])); [/color][color=#0000bb]cosa [/color][color=#007700]= ([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]-[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#0000bb]cosb [/color][color=#007700]= ([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]-[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#0000bb]cosc [/color][color=#007700]= ([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]-[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]cosa[/color][color=#007700]); [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]cosb[/color][color=#007700]); [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]cosc[/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]"diện tích tam giác abc là: "[/color][color=#007700]+ [/color][color=#0000bb]s[/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]"số đo của góc a là: "[/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#dd0000]"độ"[/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]"số đo của góc b là: "[/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#dd0000]"độ"[/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]"số đo của góc c là: "[/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#dd0000]"độ"[/color][color=#007700]);[/color]
</div>
</div>
cho em hỏi tí ở bài số 3 luc chạy thử thì số đo các góc nó lại hiển thị là nan đó là lỗi gì vạy ạ
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