-
10-31-2013, 07:00 AM #81Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
em xin nộp bài :d
<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ã:import java.util.scanner; public class bt1 { public static void main(string[] args) { scanner input = new scanner(system.in); system.out.print("nhap so sinh vien: "); int n = input.nextint(); input.nextline(); string[] danhsachsv = new string[n]; system.out.println("**nhap ten cac sinh vien**"); for (int i=0; i<n; i++) { system.out.print("sinh vien " + (i+1) + ": "); danhsachsv[i] = input.nextline(); } for (int i=0; i<n; i++) { for (int j=(i+1); j<n; j++) { if (danhsachsv[i].compareto(danhsachsv[j]) > 0) { string phu = danhsachsv[i]; danhsachsv[i] = danhsachsv[j]; danhsachsv[j] = phu; } } } system.out.print("nhap ten sinh vien can tim so thu tu: "); string timsv = input.nextline(); int phu = 0; for (int i=0; i<n; i++) { if (danhsachsv[i].equals(timsv)) { system.out.println("so thu tu cua " + timsv + " la " + (i+1)); phu = 1; break; } } if (phu == 0) { system.out.println("khong co ten " + timsv + " trong danh sach."); } } }
</div>
</div>
-
11-02-2013, 07:00 AM #82Senior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 203
mọi người xem hộ với, tự mầy mò học đó
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]
package javaapplication[/color][color=#007700];public class [/color][color=#0000bb]baitap1 [/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]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=#0000bb]int a1[/color][color=#007700], [/color][color=#0000bb]b1[/color][color=#007700], [/color][color=#0000bb]c1[/color][color=#007700]; [/color][color=#0000bb]a1[/color][color=#007700]= [/color][color=#0000bb]a [/color][color=#007700]/ [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]b1[/color][color=#007700]= [/color][color=#0000bb]b [/color][color=#007700]/ [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]c1[/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 nguyên của a là: "[/color][color=#007700]+[/color][color=#0000bb]a1[/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 là: "[/color][color=#007700]+[/color][color=#0000bb]b1[/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 là: "[/color][color=#007700]+[/color][color=#0000bb]c1[/color][color=#007700]); [/color][color=#0000bb]a1[/color][color=#007700]= [/color][color=#0000bb]a [/color][color=#007700]% [/color][color=#0000bb]3[/color][color=#007700]; [/color][color=#0000bb]b1[/color][color=#007700]= [/color][color=#0000bb]b [/color][color=#007700]% [/color][color=#0000bb]3[/color][color=#007700]; [/color][color=#0000bb]c1[/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]"phần dư của a là: "[/color][color=#007700]+[/color][color=#0000bb]a1[/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 là: "[/color][color=#007700]+[/color][color=#0000bb]b1[/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 là: "[/color][color=#007700]+[/color][color=#0000bb]c1[/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]"giá trị của 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]"giá trị của 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]"giá trị của c là: "[/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]
package javaapplication[/color][color=#007700];public class [/color][color=#0000bb]baitap2 [/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.5f[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]4.3f[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]5.2f[/color][color=#007700], [/color][color=#0000bb]x[/color][color=#007700]=[/color][color=#0000bb]0f[/color][color=#007700]; [/color][color=#0000bb]int x[/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]); [/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]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]"x="[/color][color=#007700]+[/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]
package javaapplication[/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 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]s[/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]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 tam giác là: "[/color][color=#007700]+[/color][color=#0000bb]s[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700]= (float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700](([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]s[/color][color=#007700])/([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])); [/color][color=#0000bb]b[/color][color=#007700]= (float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700](([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]s[/color][color=#007700])/([/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700])); [/color][color=#0000bb]c[/color][color=#007700]= (float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700](([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]s[/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 của tam giác lần lượt là: "[/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]
</div>
</div>
-
11-09-2013, 07:00 AM #83Junior Member
- Ngày tham gia
- Aug 2014
- Bài viết
- 9
bai 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]baitap1 [/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]57[/color][color=#007700]; [/color][color=#0000bb]int b [/color][color=#007700]= [/color][color=#0000bb]34[/color][color=#007700]; [/color][color=#0000bb]int c [/color][color=#007700]= [/color][color=#0000bb]83[/color][color=#007700]; [/color][color=#ff8000]//in phan nguyen khi chia 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]" phan nguyen (" [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]"/2) la " [/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]" phan nguyen (" [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]"/2) la " [/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]" phan nguyen (" [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]+ [/color][color=#dd0000]"/2) la " [/color][color=#007700]+ ( [/color][color=#0000bb]c [/color][color=#007700]/ [/color][color=#0000bb]2 [/color][color=#007700]) + [/color][color=#dd0000]'
'[/color][color=#007700]); [/color][color=#ff8000]//in phan du khi chia 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]" phan du ( " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]"/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 ( " [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]"/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 ( " [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]+ [/color][color=#dd0000]"/3 ) la " [/color][color=#007700]+ ( [/color][color=#0000bb]c [/color][color=#007700]% [/color][color=#0000bb]3 [/color][color=#007700]) + [/color][color=#dd0000]'
' [/color][color=#007700]); [/color][color=#ff8000]// [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]" sau khi tang len 1" [/color][color=#007700]+ [/color][color=#dd0000]", gia tri cua " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]" la " [/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]" sau khi tang len 1" [/color][color=#007700]+ [/color][color=#dd0000]", gia tri cua " [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]" la " [/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]" sau khi tang len 1" [/color][color=#007700]+ [/color][color=#dd0000]", gia tri cua " [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]+ [/color][color=#dd0000]" la " [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]++ + [/color][color=#dd0000]'
' [/color][color=#007700]); } }[/color]
</div>
</div>
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]baitap2 [/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 auto-generated method stub [/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]a [/color][color=#007700]= [/color][color=#0000bb]0f[/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]2f[/color][color=#007700]; if([/color][color=#0000bb]a [/color][color=#007700]== [/color][color=#0000bb]0[/color][color=#007700]) { if([/color][color=#0000bb]b [/color][color=#007700]== [/color][color=#0000bb]8[/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]"phuong trinh co vo so nghiem x"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].exit([/color][color=#0000bb]0[/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]"phuong trinh khong co nghiem x"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].exit([/color][color=#0000bb]0[/color][color=#007700]); } } else { [/color][color=#0000bb]float 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]"nghiem thuc cua 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]"nghiem nguyen cua phuong trinh x = " [/color][color=#007700]+ (int) [/color][color=#0000bb]x[/color][color=#007700]); } }}[/color]
</div>
</div>
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]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=#ff8000]// todo auto-generated method stub [/color][color=#0000bb]double a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700];[/color][color=#ff8000]// a, b, c la 3 canh cua tam giac. [/color][color=#0000bb]double p[/color][color=#007700];[/color][color=#ff8000]// soherong [/color][color=#0000bb]double dientich[/color][color=#007700];[/color][color=#ff8000]//s tam giac [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]5d[/color][color=#007700]; [/color][color=#ff8000]//ab=5cm [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]5d[/color][color=#007700]; [/color][color=#ff8000]//bc=5cm [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]5d[/color][color=#007700]; [/color][color=#ff8000]//ca=5cm //tinh dien tich tam giac. [/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]dientich [/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 tam giac abc la: " [/color][color=#007700]+ [/color][color=#0000bb]dientich [/color][color=#007700]+ [/color][color=#dd0000]'
'[/color][color=#007700]); [/color][color=#ff8000]//tinh so do goc a [/color][color=#0000bb]double sina [/color][color=#007700]= ([/color][color=#0000bb]2 [/color][color=#007700]* [/color][color=#0000bb]dientich[/color][color=#007700]) / ([/color][color=#0000bb]a [/color][color=#007700]* [/color][color=#0000bb]c[/color][color=#007700]);[/color][color=#ff8000]// 2s/(ab x ac) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"goca = " [/color][color=#007700]+ [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]sina[/color][color=#007700]) + [/color][color=#dd0000]" rad"[/color][color=#007700]); [/color][color=#ff8000]//tinh so do goc b [/color][color=#0000bb]double sinb [/color][color=#007700]= ([/color][color=#0000bb]2 [/color][color=#007700]* [/color][color=#0000bb]dientich[/color][color=#007700]) / ([/color][color=#0000bb]a [/color][color=#007700]* [/color][color=#0000bb]b[/color][color=#007700]);[/color][color=#ff8000]// 2s/(ab x bc) [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"gocb = " [/color][color=#007700]+ [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]sinb[/color][color=#007700]) + [/color][color=#dd0000]" rad"[/color][color=#007700]); [/color][color=#ff8000]//tinh so do goc c [/color][color=#0000bb]double sinc [/color][color=#007700]= ([/color][color=#0000bb]2 [/color][color=#007700]* [/color][color=#0000bb]dientich[/color][color=#007700]) / ([/color][color=#0000bb]b [/color][color=#007700]* [/color][color=#0000bb]c[/color][color=#007700]);[/color][color=#ff8000]// 2s/(bc x ca ); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"gocc = " [/color][color=#007700]+ [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]sinc[/color][color=#007700]) + [/color][color=#dd0000]" rad"[/color][color=#007700]); } } [/color]
</div>
</div>
-
11-15-2013, 07:00 AM #84Junior Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 1
Gửi bởi sky6596
-
11-22-2013, 07:00 AM #85Junior Member
- Ngày tham gia
- Apr 2016
- Bài viết
- 0
mong mọi người giúp đỡ cùng chia sẽ kinh nghiệm.
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]bai1 [/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]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]17[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]23[/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 la: " [/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]"phan du cua " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]" khi chia 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 nguyen cua " [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 la: " [/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]"phan du cua " [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]" khi chia 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 nguyen cua " [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 2 la: " [/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]c [/color][color=#007700]+ [/color][color=#dd0000]" khi chia cho 3 la: " [/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]"tang gia tri a,b,c moi bien len 1. gia tri moi lan luot la: " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/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 class [/color][color=#0000bb]bai2 [/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]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]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]; if ([/color][color=#0000bb]a [/color][color=#007700]== [/color][color=#0000bb]0 [/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]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]"phuong trinh vo so nghiem!"[/color][color=#007700]); else if ([/color][color=#0000bb]a [/color][color=#007700]== [/color][color=#0000bb]0 [/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]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]"phuong trinh vo nghiem!"[/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]"phuong trinh co nghiem duy nhat: " [/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]"ep kieu x ve so nguyen: " [/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 class [/color][color=#0000bb]bai3 [/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 // nhap do dai 3 canh sao cho tong do dai 2 canh bat ky lon hon canh con lai [/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]double p[/color][color=#007700], [/color][color=#0000bb]s[/color][color=#007700]; [/color][color=#0000bb]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=#ff8000]// tinh dien tich tam giac [/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]// nua chu vi tam giac [/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=#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=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/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 tam giac la: " [/color][color=#007700]+ [/color][color=#0000bb]s[/color][color=#007700]); [/color][color=#ff8000]// tinh so do 3 goc cua tam gia abc // dien tich tam giac: s = 1/2 * (b * c) * sina ==> a = arcsin(2 * s / (b * c)) // so do goc a, b, c [/color][color=#0000bb]double sina [/color][color=#007700]= ([/color][color=#0000bb]2 [/color][color=#007700]* [/color][color=#0000bb]s[/color][color=#007700]) / ([/color][color=#0000bb]b [/color][color=#007700]* [/color][color=#0000bb]c[/color][color=#007700]); [/color][color=#0000bb]double sinb [/color][color=#007700]= ([/color][color=#0000bb]2 [/color][color=#007700]* [/color][color=#0000bb]s[/color][color=#007700]) / ([/color][color=#0000bb]a [/color][color=#007700]* [/color][color=#0000bb]c[/color][color=#007700]); [/color][color=#0000bb]double sinc [/color][color=#007700]= ([/color][color=#0000bb]2 [/color][color=#007700]* [/color][color=#0000bb]s[/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]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]sina[/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]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]sinb[/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]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]sinc[/color][color=#007700]))); }}[/color]
</div>
</div>
-
12-22-2013, 07:00 AM #86Junior Member
- Ngày tham gia
- Apr 2014
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
[/color][color=#007700]class [/color][color=#0000bb]bai1[/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]d1[/color][color=#007700],[/color][color=#0000bb]d2[/color][color=#007700],[/color][color=#0000bb]d3[/color][color=#007700],[/color][color=#0000bb]t1[/color][color=#007700],[/color][color=#0000bb]t2[/color][color=#007700],[/color][color=#0000bb]t3[/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]7[/color][color=#007700]; [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]8[/color][color=#007700]; [/color][color=#0000bb]t1[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]t2[/color][color=#007700]=[/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]t3[/color][color=#007700]=[/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]d1[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]d2[/color][color=#007700]=[/color][color=#0000bb]b[/color][color=#007700]%[/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]d3[/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]"a/2="[/color][color=#007700]+[/color][color=#0000bb]t1[/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/2="[/color][color=#007700]+[/color][color=#0000bb]t2[/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/2="[/color][color=#007700]+[/color][color=#0000bb]t3[/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/2 du la "[/color][color=#007700]+[/color][color=#0000bb]d1[/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/2 du la "[/color][color=#007700]+[/color][color=#0000bb]d2[/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/2 du la "[/color][color=#007700]+[/color][color=#0000bb]d3[/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 sau khi tang la "[/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 sau khi tang la "[/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 sau khi tang la "[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]); }}[/color]
</div>
</div>
-
01-21-2014, 07:00 AM #87Junior Member
- Ngày tham gia
- May 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote></blockquote></div>
</div>
</div>
Mã nguồn PHP:[color=#000000]
package edu[/color][color=#007700].[/color][color=#0000bb]javabasic[/color][color=#007700]; [/color][color=#ff8000]/**** @author hung*/[/color][color=#007700]public class [/color][color=#0000bb]bai4_1 [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]int a[/color][color=#007700]=[/color][color=#0000bb]4[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]7[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]9[/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 lan luot la:"[/color][color=#007700]+([/color][color=#0000bb]a[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700])+ [/color][color=#dd0000]" ;" [/color][color=#007700]+([/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700])+ [/color][color=#dd0000]" ;"[/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 khi chia a,b,c cho 3 lan luot la:"[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700]+[/color][color=#dd0000]" ;"[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]%[/color][color=#0000bb]3[/color][color=#007700]+[/color][color=#dd0000]" ;"[/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]"sau khi tang len 1 don vi thi 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]
-
02-05-2014, 07:00 AM #88Junior Member
- Ngày tham gia
- May 2014
- Bài viết
- 0
tiasangmoi92 anh có thể giải thích giúp em được không ạ
trituyetdoi = math.abs(a);
system.out.println("giá trị tuyệt đối của a là: "+trituyetdoi);
can = (float) math.sqrt(b);
em không hiểu tại sao lại có float ở phần tính căn. trong khi trị tuyệt đối thì lại không cần phải như vậy
-
02-18-2014, 07:00 AM #89Junior Member
- Ngày tham gia
- Apr 2016
- 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 static void main(string[] args) { int a = 9, b = 2, c = 1995; int phannguyen_a = a / 2, phannguyen_b = b / 2, phannguyen_c = c / 2; system.out.println("phan nguyen cua " + a + ":2= " + phannguyen_a); system.out.println("phan nguyen cua " + b + ":2= " + phannguyen_b); system.out.println("phan nguyen cua " + c + ":2= " + phannguyen_c); int phandu_a = a % 3, phandu_b = b % 3, phandu_c = c % 3; system.out.println("phan du cua " + a + ":3= " + phandu_a); system.out.println("phan du cua " + b + ":3= " + phandu_b); system.out.println("phan du cua " + c + ":3= " + phandu_c); a++; b++; c++; system.out.println("gia tri cac so sau khi tang la a= " + a + " b= " + b + " c=" + 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 static void main(string[] args) { float a = 10.5f, b = 12.5f, c = 95f; tim_x(a, b, c); } public static void tim_x(float a, float b, float c) { // phuong trinh: 2ax+b=8c float x; if ((8 * c - b) == 0 && (a != 0)) { system.out.println("x=0"); } if ((8 * c - b) != 0 && (a != 0)) { x = (8 * c - b) / a; system.out.println("gia tri kieu int cua \"x\" la: " + (int) x); } if ((8 * c - b) != 0 && (a == 0)) { system.out.println("phuong trinh vo nghiem!"); } if ((8 * c - b) == 0 && (a == 0)) { system.out.println("phuong trinh co vo so nghiem!"); } }
</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 static void main(string[] args) { float a = (float) math.sqrt(2), b = (float) math.sqrt(2), c = 2; dientichtamgiac(a, b, c); timgoc(a, b, c); } public static void dientichtamgiac(float a, float b, float c) { double p = (a + b + c) / 2; //tinh 1/2 chu vi double s = math.sqrt(p * (p - a) * (p - b) * (p - c)); //cong thuc heron system.out.println("dien tich tam giac la: " + s+" (dvdt)"); } public static void timgoc(float a, float b, float c) { double cosa, cosb, cosc; cosa = (b * b + c * c - a * a) / (2 * b * c); double goca = math.acos(cosa); system.out.println("goc thu 1 = " + goca + " (rad)"); cosb = (a * a + c * c - b * b) / (2 * a * c); double gocb = math.acos(cosb); system.out.println("goc thu 2 = " + gocb + " (rad)"); cosc = (a * a + b * b - c * c) / (2 * a * b); double gocc = math.acos(cosc); system.out.println("goc thu 3 = " + gocc + " (rad)"); }
</div>
</div>
-
02-19-2014, 07:00 AM #90Junior Member
- Ngày tham gia
- Mar 2014
- Bài viết
- 0
xin nộp bài:
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 baitap1 { public static void main(string[] args){ int a=16,b=17,c=18, nguyena , nguyenb ,nguyenc ,dua ,dub ,duc ; nguyena=a/2; nguyenb=b/2; nguyenc=c/2; dua=a%3; dub=b%3; duc=c%3; system.out.println("số nguyên a chia cho 2 là "+ nguyena ); system.out.println("số nguyên b chia cho 2 là "+ nguyenb ); system.out.println("số nguyên c chia cho 2 là"+ nguyenc); system.out.println("số dư a chia cho 3 là"+dua); system.out.println("số dư b chia cho 3 là"+dub); system.out.println("số dư c chia cho 3 là"+duc); a++; b++; c++; system.out.println("số a tăng lên 1 là"+a); system.out.println("số b tăng lên 1 là"+b); system.out.println("số c tăng lên 1 là"+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 baitap2 { public static void main(string[] args){ float a=3,b=4,c=5,x; x=(8*c-b)/(2*a); system.out.println("kết quả x của phương trình 2ax+b=8c là : "+x); int y= (int) x; system.out.println("giá trị x sau khi ép thành số nguyên là : "+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 baitap3 { public static void main(string[] args){ double a=3,b=4,c=5,s,p,goca,gocb,gocc,tonggoc; p=(a+b+c)/2; s=math.sqrt(p*(p-a)*(p-b)*(p-c)); system.out.println("diện tích hình chữ nhật đã cho là : " +s); goca=math.todegrees(math.acos((b*b+c*c-a*a)/(2*b*c))); gocb=math.todegrees(math.acos((c*c+a*a-b*b)/(2*a*c))); gocc=math.todegrees(math.acos((a*a+b*b-c*c)/(2*a*b))); tonggoc=goca+gocb+gocc; system.out.println("góc thứ nhất là : "+ goca); system.out.println("góc thứ hai là : "+gocb); system.out.println("góc thứ ba là : "+gocc); system.out.println("tổng 3 góc là : "+tonggoc); }
</div>
</div>
Bài văn khấn nhập trạch chuyển về văn phòng mới đầy đủ chính xác giúp cho công ty, doanh nghiệp tại văn phòng mới được đấng bề trên soi xét phù hộ gặp được nhiều may mắn, làm ăn thuận lợi. Bài viết...
Bài văn khấn nhập trạch chuyển về văn phòng mới đầy đủ nhất