-
03-14-2014, 07:00 AM #101Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
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]
package chuong4[/color][color=#007700]; public class [/color][color=#0000bb]baitap3 [/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 ab [/color][color=#007700]= [/color][color=#0000bb]3f[/color][color=#007700], [/color][color=#0000bb]ac[/color][color=#007700]=[/color][color=#0000bb]4f [/color][color=#007700], [/color][color=#0000bb]bc[/color][color=#007700]=[/color][color=#0000bb]5f [/color][color=#007700], [/color][color=#0000bb]s[/color][color=#007700], [/color][color=#0000bb]p[/color][color=#007700]; [/color][color=#0000bb]double sin_a[/color][color=#007700],[/color][color=#0000bb]sin_b[/color][color=#007700],[/color][color=#0000bb]sin_c[/color][color=#007700]; [/color][color=#0000bb]p[/color][color=#007700]=([/color][color=#0000bb]ab[/color][color=#007700]+[/color][color=#0000bb]bc[/color][color=#007700]+[/color][color=#0000bb]ac[/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]ab[/color][color=#007700])*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]ac[/color][color=#007700])*([/color][color=#0000bb]p[/color][color=#007700]-[/color][color=#0000bb]bc[/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 = " [/color][color=#007700]+[/color][color=#0000bb]s[/color][color=#007700]); [/color][color=#0000bb]sin_a [/color][color=#007700]= (float) (([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]s[/color][color=#007700])/([/color][color=#0000bb]ab[/color][color=#007700]*[/color][color=#0000bb]ac[/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]"góc 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]asin[/color][color=#007700]([/color][color=#0000bb]sin_a[/color][color=#007700]))); [/color][color=#0000bb]sin_b [/color][color=#007700]= (float) (([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]s[/color][color=#007700])/([/color][color=#0000bb]ab[/color][color=#007700]*[/color][color=#0000bb]bc[/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]"góc 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]asin[/color][color=#007700]([/color][color=#0000bb]sin_b[/color][color=#007700]))); [/color][color=#0000bb]sin_c [/color][color=#007700]= (float) (([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]s[/color][color=#007700])/([/color][color=#0000bb]bc[/color][color=#007700]*[/color][color=#0000bb]ac[/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]"góc 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]asin[/color][color=#007700]([/color][color=#0000bb]sin_c[/color][color=#007700]))); } }[/color]
</div>
</div>
-
03-21-2014, 07:00 AM #102Junior Member
- Ngày tham gia
- Aug 2015
- Bài viết
- 0
chào các bạn, mình là mem mới, dưới đây là bt của mình.
bt01
Mã:public class para01 { public static void main(string[] args) { int a = 621; int b = 634; int c = 111; system.out.println("a=" + a + "\tb=" + b + "\tc=" + c); system.out.println("phan nguyen khi chia a,b,c cho 2: a: " + (a/2) + "\tb=" + (b/2) + "\tc=" + (c/2)); system.out.println("phan dd khi chia a,b,c cho 3: a: " + (a%3) + "\tb=" + (b%3) + "\tc=" + (c%3)); system.out.println("tang khi c a,b,c them 1 a: " + (++a) + "\tb=" + (++b) + "\tc=" + (++c)); } }
Mã:public class para02 { public static void main(string[] args) { float a = 4f, b = 8f, c = 10f, x; system.out.println("giai phuong trinh bac nhat : 2ax + b = 8c"); system.out.print("voi a = 4, b = 8, c = 10. x?"); float res = (8*c - b)/(2*a); res = (int) res; system.out.print(" x = " + res); } }
Mã:public class para03 { public static void main(string[] args) { double a = 12f, b = 8f, c = 7f; double a, b, c; system.out.println("do dai 3 canh tam giac: a=" + a + "\tb=" + b + "\tc=" + c); a = math.acos((b*b+c*c - a*a)/(2*b*c)); b = math.acos((a*a+c*c - b*b)/(2*a*c)); c = math.acos((a*a+b*b - c*c)/(2*a*b)); system.out.println("so do 3 goc tam giac: a=" + math.todegrees(a) + "\tb=" + math.todegrees(b) + "\tc=" + math.todegrees(c)); } }
-
03-21-2014, 07:00 AM #103Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
chào các bạn, mình là mem mới, dưới đây là bt của mình.
bt01
Mã nguồn PHP:[color=#000000]
[/color][color=#007700]public class [/color][color=#0000bb]para01 [/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]621[/color][color=#007700]; [/color][color=#0000bb]int b [/color][color=#007700]= [/color][color=#0000bb]634[/color][color=#007700]; [/color][color=#0000bb]int c [/color][color=#007700]= [/color][color=#0000bb]111[/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=#dd0000]"\tb=" [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]"\tc=" [/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]"phan nguyen khi chia a,b,c cho 2:
a: " [/color][color=#007700]+ ([/color][color=#0000bb]a[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]) + [/color][color=#dd0000]"\tb=" [/color][color=#007700]+ ([/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]) + [/color][color=#dd0000]"\tc=" [/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]"phan dd khi chia a,b,c cho 3:
a: " [/color][color=#007700]+ ([/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700]) + [/color][color=#dd0000]"\tb=" [/color][color=#007700]+ ([/color][color=#0000bb]b[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700]) + [/color][color=#dd0000]"\tc=" [/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 khi c a,b,c them 1
a: " [/color][color=#007700]+ (++[/color][color=#0000bb]a[/color][color=#007700]) + [/color][color=#dd0000]"\tb=" [/color][color=#007700]+ (++[/color][color=#0000bb]b[/color][color=#007700]) + [/color][color=#dd0000]"\tc=" [/color][color=#007700]+ (++[/color][color=#0000bb]c[/color][color=#007700])); }}[/color]
Mã nguồn PHP:[color=#000000]
[/color][color=#007700]public class [/color][color=#0000bb]para02 [/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]4f[/color][color=#007700], [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]8f[/color][color=#007700], [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]10f[/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 bac nhat : 2ax + b = 8c"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"voi a = 4, b = 8, c = 10. x?"[/color][color=#007700]); [/color][color=#0000bb]float res [/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]res [/color][color=#007700]= (int) [/color][color=#0000bb]res[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"
x = " [/color][color=#007700]+ [/color][color=#0000bb]res[/color][color=#007700]); }}[/color]
Mã:public class para03 { public static void main(string[] args) { double a = 12f, b = 8f, c = 7f; double a, b, c; system.out.println("do dai 3 canh tam giac: a=" + a + "\tb=" + b + "\tc=" + c); a = math.acos((b*b+c*c - a*a)/(2*b*c)); b = math.acos((a*a+c*c - b*b)/(2*a*c)); c = math.acos((a*a+b*b - c*c)/(2*a*b)); system.out.println("so do 3 goc tam giac: a=" + math.todegrees(a) + "\tb=" + math.todegrees(b) + "\tc=" + math.todegrees(c)); } }
-
03-28-2014, 07:00 AM #104Junior Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 0
nộp bài đây các bạn chỉ giáo dùm nhé
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=#ff8000]/** to change this license header, choose license headers in project properties.* to change this template file, choose tools | templates* and open the template in the editor.*/ [/color][color=#0000bb]package bai04_bt1[/color][color=#007700];[/color][color=#ff8000]//bài 1: các biến a, b, c là các số nguyên. gán giá trị cho các biến.//tìm phần nguyên khi chia các số này cho 2, tìm phần dư khi chia các//số này cho 3, in kết quả ra màn hình. tăng giá trị a, b, c mỗi biến// lên 1, in giá trị 3 số ra màn hình/**** @author administrator*/[/color][color=#007700]public class [/color][color=#0000bb]bt1 [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/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=#ff8000]// todo code application logic here [/color][color=#0000bb]short a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#ff8000]// gán giá trị cho các biến [/color][color=#0000bb]a[/color][color=#007700]=[/color][color=#0000bb]20[/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]22[/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]"giá trị các biến a,b,c: "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#dd0000]", "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]", "[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]); [/color][color=#ff8000]// tìm phần nguyên khi chia các số cho 2 [/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 khi chia biến a cho 2: " [/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 khi chia biến b cho 2: " [/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 khi chia biến c cho 2: " [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]); [/color][color=#ff8000]// tìm phần dư khi chia các số này cho 3 [/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ư khi chia biến a cho 3: " [/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ư khi chia biến b cho 3: " [/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ư khi chia biến c cho 3: " [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700]); [/color][color=#ff8000]// tăng giá trị các biến lên 1 và in ra màn hình [/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].print([/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>
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=#ff8000]/** to change this license header, choose license headers in project properties.* to change this template file, choose tools | templates* and open the template in the editor.*///bài 2: giải phương trình 2ax+b = 8c với a, b, c là số thực – được//gán giá trị trong chương trình, x cũng là số thực, là giá trị cần//tìm. sau khi tính x in kết quả ra màn hình, ép kiểu x về số nguyên,//in kết quả ép kiểu của x ra màn hình![/color][color=#0000bb]package bai04_bt2[/color][color=#007700];[/color][color=#ff8000]/**** @author administrator*/[/color][color=#007700]public class [/color][color=#0000bb]bt2 [/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=#ff8000]// code giải phương trình 2ax+b=8c [/color][color=#0000bb]float a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#ff8000]// khai báo các biến thực a,b,c [/color][color=#0000bb]float x[/color][color=#007700]; [/color][color=#ff8000]// khai báo biến x // gán giá trị cho a,b,c [/color][color=#0000bb]a[/color][color=#007700]=[/color][color=#0000bb]10[/color][color=#007700]; [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]20[/color][color=#007700]; [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]30[/color][color=#007700]; [/color][color=#ff8000]// tính x [/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]); [/color][color=#ff8000]// xuất giá trị x ra màn hình [/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=#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][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"giá trị x="[/color][color=#007700]+[/color][color=#0000bb]x[/color][color=#007700]); [/color][color=#ff8000]// khai báo biến xnguyen [/color][color=#0000bb]short xnguyen[/color][color=#007700]; [/color][color=#0000bb]xnguyen[/color][color=#007700]=([/color][color=#0000bb]short[/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=#0000bb]xnguyen[/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=#ff8000]/** to change this license header, choose license headers in project properties.* to change this template file, choose tools | templates* and open the template in the editor.*///bài 3: cho a, b, c là độ dài 3 cạnh tam giác, a, b, c được gán//giá trị trong chương trình. viết chương trình tính diện tích s//của tam giác, in kết quả ra màn hình. tìm số đo 3 góc của tam//giác đó, in kết quả ra màn hình.[/color][color=#0000bb]package bai04_bt3[/color][color=#007700]; [/color][color=#ff8000]/**** @author administrator*/[/color][color=#007700]public class [/color][color=#0000bb]bt3 [/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=#ff8000]//khai báo biến abc chứa 3 canh tam giác [/color][color=#0000bb]float a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#0000bb]float s[/color][color=#007700],[/color][color=#0000bb]p[/color][color=#007700]; [/color][color=#ff8000]//gán giá trị các biến [/color][color=#0000bb]a[/color][color=#007700]=[/color][color=#0000bb]3.5f[/color][color=#007700]; [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]2.6f[/color][color=#007700]; [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]3.8f[/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=#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][color=#ff8000]//tính diện tích bằng công thức hê rông [/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]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 s= "[/color][color=#007700]+[/color][color=#0000bb]s[/color][color=#007700]); [/color][color=#ff8000]// tính các góc [/color][color=#0000bb]float alpha[/color][color=#007700],[/color][color=#0000bb]beta[/color][color=#007700],[/color][color=#0000bb]gamma[/color][color=#007700]; [/color][color=#0000bb]alpha[/color][color=#007700]=(float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700])+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]c[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700])-[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700],[/color][color=#0000bb]2[/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]beta[/color][color=#007700]=(float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700])+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]c[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700])-[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]2[/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]gamma[/color][color=#007700]=(float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700])+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]2[/color][color=#007700])-[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]pow[/color][color=#007700]([/color][color=#0000bb]c[/color][color=#007700],[/color][color=#0000bb]2[/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]"các gó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]"α="[/color][color=#007700]+[/color][color=#0000bb]alpha[/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]"β="[/color][color=#007700]+[/color][color=#0000bb]beta[/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]"γ="[/color][color=#007700]+[/color][color=#0000bb]gamma[/color][color=#007700]); }}[/color]
</div>
</div>
-
04-07-2014, 07:00 AM #105Junior Member
- Ngày tham gia
- Apr 2014
- Bài viết
- 0
bai 3:
Mã nguồn PHP:[color=#000000]
[/color][color=#007700]public class [/color][color=#0000bb]baitap3 [/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]a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/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]dientich[/color][color=#007700], [/color][color=#0000bb]h[/color][color=#007700]; [/color][color=#0000bb]a[/color][color=#007700]= [/color][color=#0000bb]6[/color][color=#007700]; [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]5[/color][color=#007700]; [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]7[/color][color=#007700]; [/color][color=#0000bb]_cosc[/color][color=#007700]=([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/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]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]b[/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]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]2[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]); [/color][color=#0000bb]_cosa[/color][color=#007700]=(-[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/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]2[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]b[/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]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]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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"góc a là : "[/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]"góc b là : "[/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]"góc c là : "[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]); [/color][color=#0000bb]h[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sin[/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]"chiều cao của tam giác ứng với cạnh đáy c: "[/color][color=#007700]+[/color][color=#0000bb]h[/color][color=#007700]); [/color][color=#0000bb]dientich[/color][color=#007700]= ([/color][color=#0000bb]h[/color][color=#007700]/[/color][color=#0000bb]2[/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]"diện tích của tam giác: "[/color][color=#007700]+[/color][color=#0000bb]dientich[/color][color=#007700]); }}[/color]
-
04-22-2014, 07:00 AM #106Member
- Ngày tham gia
- Feb 2016
- Bài viết
- 42
mình nộp bài
bài 1: các biến a, b, c là các số nguyên. gán giá trị cho các biến. tìm phần nguyên khi chia các số này cho 2, tìm phần dư khi chia các số này cho 3, in kết quả ra màn hình. tăng giá trị a, b, c mỗi biến lên 1, in giá trị 3 số ra màn hình.
<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]learnjava [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/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]int nguyen_a[/color][color=#007700], [/color][color=#0000bb]nguyen_b[/color][color=#007700], [/color][color=#0000bb]nguyen_c[/color][color=#007700]; [/color][color=#0000bb]int du_a[/color][color=#007700], [/color][color=#0000bb]du_b[/color][color=#007700], [/color][color=#0000bb]du_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]9[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]18[/color][color=#007700]; [/color][color=#ff8000]// phan nguyen [/color][color=#0000bb]nguyen_a [/color][color=#007700]= [/color][color=#0000bb]a [/color][color=#007700]/ [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]nguyen_b [/color][color=#007700]= [/color][color=#0000bb]b [/color][color=#007700]/ [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]nguyen_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]"phan nguyen cua " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 = " [/color][color=#007700]+ [/color][color=#0000bb]nguyen_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]"phan nguyen cua " [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 = " [/color][color=#007700]+ [/color][color=#0000bb]nguyen_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]"phan nguyen cua " [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 = " [/color][color=#007700]+ [/color][color=#0000bb]nguyen_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]""[/color][color=#007700]); [/color][color=#ff8000]// phan du [/color][color=#0000bb]du_a [/color][color=#007700]= [/color][color=#0000bb]a [/color][color=#007700]% [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]du_b [/color][color=#007700]= [/color][color=#0000bb]b [/color][color=#007700]% [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]du_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]"phan du cua " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 = " [/color][color=#007700]+ [/color][color=#0000bb]du_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]"phan du cua " [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 = " [/color][color=#007700]+ [/color][color=#0000bb]du_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]"phan du cua " [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 = " [/color][color=#007700]+ [/color][color=#0000bb]du_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]""[/color][color=#007700]); [/color][color=#ff8000]// tang gia tri a, b, c [/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]"gia tri moi cua 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]"gia tri moi cua 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]"gia tri moi cua c = " [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]); }}[/color]
</div>
</div>
bài 2: giải phương trình 2ax+b = 8c với a, b, c là số thực – được gán giá trị trong chương trình, x cũng là số thực, là giá trị cần tìm. sau khi tính x in kết quả ra màn hình, ép kiểu x về số nguyên, in kết quả ép kiểu của x ra màn hình!
<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]learnjava [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/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]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700], [/color][color=#0000bb]x[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]4.3f[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]2.5f[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]8f[/color][color=#007700]; [/color][color=#ff8000]// tim gia tri x [/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]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"gia tri cua x can tim la: " [/color][color=#007700]+ [/color][color=#0000bb]x[/color][color=#007700]); [/color][color=#ff8000]// ep kieu [/color][color=#0000bb]int new_x [/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]"gia tri cua x sau khi ep kieu la: " [/color][color=#007700]+ [/color][color=#0000bb]new_x[/color][color=#007700]); }}[/color]
</div>
</div>
bài 3: cho a, b, c là độ dài 3 cạnh tam giác, a, b, c được gán giá trị trong chương trình. viết chương trình tính diện tích s của tam giác, in kết quả ra màn hình. tìm số đo 3 góc của tam giác đó, in kết quả ra màn hình.
<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]learnjava [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/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]double p[/color][color=#007700], [/color][color=#0000bb]s[/color][color=#007700]; [/color][color=#0000bb]double goc_a[/color][color=#007700], [/color][color=#0000bb]goc_b[/color][color=#007700], [/color][color=#0000bb]goc_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]6[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]7[/color][color=#007700]; [/color][color=#ff8000]// tinh nua chu vi p [/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=#ff8000]// tinh dien tich s [/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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"dien tich s = " [/color][color=#007700]+ [/color][color=#0000bb]s[/color][color=#007700]); [/color][color=#ff8000]// tinh goc su dung dung ly cos [/color][color=#0000bb]goc_a [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/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]goc_b [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/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]goc_c [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]a [/color][color=#007700]* [/color][color=#0000bb]a [/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]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]"so do goc a = " [/color][color=#007700]+ [/color][color=#0000bb]goc_a [/color][color=#007700]+ [/color][color=#dd0000]" rad"[/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]"so do goc b = " [/color][color=#007700]+ [/color][color=#0000bb]goc_b [/color][color=#007700]+ [/color][color=#dd0000]" rad"[/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]"so do goc c = " [/color][color=#007700]+ [/color][color=#0000bb]goc_c [/color][color=#007700]+ [/color][color=#dd0000]" rad"[/color][color=#007700]); }}[/color]
</div>
</div>
-
04-22-2014, 07:00 AM #107Banned
- Ngày tham gia
- Feb 2015
- Bài viết
- 0
public class demo {
public static void main (string[] args){
int a=2, b=12, c =11;
// bai 1
system.out.println("phan nguyen:a: "+a/2+" b: "+b/2+" +c: "+c/2);
system.out.println("phan du a: "+a%3+" b: "+b%3+" +c: "+c%3);
a++; b++; c++;
system.out.println("tag len 1 don vi a: "+ a +" b: "+b +" +c: "+c);
// bai 2
float result= (8*c-b)/(2*a);
system.out.println("result:"+ result+" reslut: "+(int)result);
// bai 3
float p=(float)(a+b+c)/2;
float s=(float) math.sqrt(p*(p-a)*(p-b)*(p-c));
system.out.println("dien tich tam giac s:"+s);
float cos_a=(float)(b*b+c*c-a*a)/(2*b*c);
float cos_b=(float)(a*a+c*c-b*b)/(2*a*c);
float cos_c=(float)(b*b+a*a-c*c)/(2*b*a);
system.out.println("goc a:"+ math.todegrees(math.acos(cos_a)));
system.out.println("goc b:"+ math.todegrees(math.acos(cos_b)));
system.out.println("goc c:"+ math.todegrees(math.acos(cos_c)));
}
}
-
04-25-2014, 07:00 AM #108Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 0
hix các sep không chấm bài nữa ah e nộp tiếp này
<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]10[/color][color=#007700];[/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]5[/color][color=#007700];[/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]6[/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]"phan du khi chia a cho 3 la:"[/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]"phan du khi chia b cho 3 la:"[/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]"phan du khi chia c cho 3la :"[/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]"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]float 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]a[/color][color=#007700]=[/color][color=#0000bb]20f[/color][color=#007700];[/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]8f[/color][color=#007700];[/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]7f[/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]"so a phai khac o;"[/color][color=#007700]); } else {[/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]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"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]"x da ep la: "[/color][color=#007700]+(int)[/color][color=#0000bb]x[/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]3d[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]4d[/color][color=#007700],[/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]5d[/color][color=#007700],[/color][color=#0000bb]s[/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]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]double d[/color][color=#007700]=[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]s[/color][color=#007700]/([/color][color=#0000bb]0.5[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])),[/color][color=#0000bb]e[/color][color=#007700]=[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]s[/color][color=#007700]/([/color][color=#0000bb]0.5[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])),[/color][color=#0000bb]f[/color][color=#007700]=[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700]([/color][color=#0000bb]s[/color][color=#007700]/([/color][color=#0000bb]0.5[/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]"goc a la "[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]d[/color][color=#007700])+[/color][color=#dd0000]"; goc b la:"[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]to[/color][color=#007700]+[/color][color=#dd0000]"; goc c la:"[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]f[/color][color=#007700])+[/color][color=#dd0000]" ;"[/color][color=#007700]); }}[/color]
</div>
</div>
-
05-06-2014, 07:00 AM #109Silver member
- Ngày tham gia
- Jan 2016
- Bài viết
- 280
bài 1:
public static void main(string[] args)
{
int a=2,b=3,c=4;
system.out.println("tìm phần nguyên khi chia các số này cho 2");
system.out.println("a/2
=" +a/2+ "
b/2
="+b/2+"
c/2
="+c/2);
system.out.println("tìm phần dư khi chia các số này cho 3, in kết quả ra màn hình.");
system.out.println("a%3
="+a%3+ "
b%3
="+b%3+"
c%3
="+c%3);
system.out.println("tăng giá trị a, b, c mỗi biến lên 1, in giá trị 3 số ra màn hình");
a+=1;
system.out.println(a);
b+=1;
system.out.println(b);
c+=1;
system.out.println(c);
}
bài 2:
public static void main(string[] args)
{
float a=2.3f ,b=1.2f ,c=4.3f;
float x;
int y;
x=(8*c-b)/(2*a);
system.out.println(x);
y=(int) x;
system.out.println("số nguyên ép kiểu từ số thực là: " + y);
// todo code application logic here
}
bài 3:
public static void main(string[] args)
{
double a=33, b=56, c=34, h, goca, gocb, gocc;
double s,dt,p;
p= (a+b+c)/2;
system.out.println("chu vi tam giac :"+p);
s=(p*(p-a)*(p-b)*(p-c));
dt= math.sqrt(s);
system.out.println("dien tich tam giac la:"+dt);
h=(dt*2)/b;
goca=h/a;
goca=math.sin(goca);
goca=math.todegrees(goca);
system.out.println("goc a :" +goca);
gocb=h/b;
gocb=math.sin(gocb);
gocb=math.todegrees(gocb);
system.out.println("goc b: "+gocb);
gocc=h/c;
gocc=math.sin(c);
gocc=math.todegrees(gocc);
system.out.println("goc c :" +gocc);
// todo code application logic here
}
-
06-19-2014, 07:00 AM #110Junior Member
- Ngày tham gia
- Mar 2015
- Bài viết
- 0
Mã nguồn PHP:[color=#000000]
[/color][color=#ff8000]//bài tập //bai1[/color][color=#007700]public class [/color][color=#0000bb]helloworld [/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 q[/color][color=#007700], [/color][color=#0000bb]k [/color][color=#007700],[/color][color=#0000bb]p[/color][color=#007700]; [/color][color=#0000bb]q[/color][color=#007700]= [/color][color=#0000bb]5[/color][color=#007700]; [/color][color=#0000bb]k [/color][color=#007700]=[/color][color=#0000bb]8[/color][color=#007700]; [/color][color=#0000bb]p [/color][color=#007700]=[/color][color=#0000bb]17[/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]"phan nguyên của (q:2) là: "[/color][color=#007700]+[/color][color=#0000bb]q[/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]"phan nguyên của (k:2) là: "[/color][color=#007700]+[/color][color=#0000bb]k[/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]"phan nguyên của (p:2) là: "[/color][color=#007700]+[/color][color=#0000bb]p[/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]"
"[/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]"so du của (q:2) là: "[/color][color=#007700]+[/color][color=#0000bb]q[/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]"so du của (k:2) là: "[/color][color=#007700]+[/color][color=#0000bb]k[/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]"so du của (p:2) là: "[/color][color=#007700]+[/color][color=#0000bb]p[/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]"
"[/color][color=#007700]); [/color][color=#0000bb]q[/color][color=#007700]++; [/color][color=#0000bb]k[/color][color=#007700]++; [/color][color=#0000bb]p[/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]"gia tri cua q, k, q sau khi tang len la: "[/color][color=#007700]+[/color][color=#0000bb]q[/color][color=#007700]+[/color][color=#dd0000]" , "[/color][color=#007700]+[/color][color=#0000bb]k[/color][color=#007700]+[/color][color=#dd0000]" , "[/color][color=#007700]+[/color][color=#0000bb]p[/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]"
"[/color][color=#007700]); [/color][color=#ff8000]//bai2 [/color][color=#0000bb]float o[/color][color=#007700], [/color][color=#0000bb]w[/color][color=#007700], [/color][color=#0000bb]z[/color][color=#007700], [/color][color=#0000bb]j[/color][color=#007700]; [/color][color=#0000bb]o [/color][color=#007700]= [/color][color=#0000bb]2.7f[/color][color=#007700]; [/color][color=#0000bb]w [/color][color=#007700]= [/color][color=#0000bb]1.5f[/color][color=#007700]; [/color][color=#0000bb]z [/color][color=#007700]= [/color][color=#0000bb]5.2f[/color][color=#007700]; if([/color][color=#0000bb]o[/color][color=#007700]!= [/color][color=#0000bb]0[/color][color=#007700]) { [/color][color=#0000bb]j [/color][color=#007700]= (([/color][color=#0000bb]8[/color][color=#007700]*[/color][color=#0000bb]z[/color][color=#007700])-[/color][color=#0000bb]w[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]o[/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]"gia tri j tim duoc la: "[/color][color=#007700]+[/color][color=#0000bb]j[/color][color=#007700]); [/color][color=#0000bb]j [/color][color=#007700]= (int) [/color][color=#0000bb]j[/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]"gia tri cua j sau khi ep kieu la: "[/color][color=#007700]+[/color][color=#0000bb]j[/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]"a khong duoc bang 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]"
"[/color][color=#007700]); [/color][color=#ff8000]//bài3 [/color][color=#0000bb]float canh1[/color][color=#007700], [/color][color=#0000bb]canh2[/color][color=#007700],[/color][color=#0000bb]canh3[/color][color=#007700], [/color][color=#0000bb]dt[/color][color=#007700], [/color][color=#0000bb]cv[/color][color=#007700]; [/color][color=#0000bb]canh1 [/color][color=#007700]= [/color][color=#0000bb]5[/color][color=#007700]; [/color][color=#0000bb]canh2 [/color][color=#007700]= [/color][color=#0000bb]6[/color][color=#007700]; [/color][color=#0000bb]canh3 [/color][color=#007700]= [/color][color=#0000bb]7[/color][color=#007700]; [/color][color=#0000bb]cv [/color][color=#007700]= (float)([/color][color=#0000bb]canh1 [/color][color=#007700]+ [/color][color=#0000bb]canh2 [/color][color=#007700]+ [/color][color=#0000bb]canh3[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]dt [/color][color=#007700]= (float)([/color][color=#0000bb]cv[/color][color=#007700]*([/color][color=#0000bb]cv[/color][color=#007700]-[/color][color=#0000bb]canh1[/color][color=#007700])*([/color][color=#0000bb]cv[/color][color=#007700]-[/color][color=#0000bb]canh2[/color][color=#007700])*([/color][color=#0000bb]cv[/color][color=#007700]-[/color][color=#0000bb]canh3[/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]"dien tich cua tam giac là: "[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]dt[/color][color=#007700])); [/color][color=#0000bb]double goc1[/color][color=#007700]= (float)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]canh2 [/color][color=#007700]*[/color][color=#0000bb]canh2[/color][color=#007700]+[/color][color=#0000bb]canh1[/color][color=#007700]*[/color][color=#0000bb]canh1[/color][color=#007700])- ([/color][color=#0000bb]canh3[/color][color=#007700]*[/color][color=#0000bb]canh3[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]canh2[/color][color=#007700]*[/color][color=#0000bb]canh1[/color][color=#007700])); [/color][color=#0000bb]double goc2[/color][color=#007700]= (float)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]canh1 [/color][color=#007700]*[/color][color=#0000bb]canh1[/color][color=#007700]+[/color][color=#0000bb]canh3[/color][color=#007700]*[/color][color=#0000bb]canh3[/color][color=#007700])- ([/color][color=#0000bb]canh2[/color][color=#007700]*[/color][color=#0000bb]canh2[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]canh3[/color][color=#007700]*[/color][color=#0000bb]canh1[/color][color=#007700])); [/color][color=#0000bb]double goc3[/color][color=#007700]= (float)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]acos[/color][color=#007700](([/color][color=#0000bb]canh3 [/color][color=#007700]*[/color][color=#0000bb]canh3[/color][color=#007700]+[/color][color=#0000bb]canh2[/color][color=#007700]*[/color][color=#0000bb]canh2[/color][color=#007700])- ([/color][color=#0000bb]canh1[/color][color=#007700]*[/color][color=#0000bb]canh1[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]canh3[/color][color=#007700]*[/color][color=#0000bb]canh2[/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]"so do cua 3 goc la: "[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]goc1[/color][color=#007700])+[/color][color=#dd0000]" , "[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]goc2[/color][color=#007700])+[/color][color=#dd0000]" , "[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]goc3[/color][color=#007700]));}} [/color]
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