Trang 3 của 13 Đầu tiênĐầu tiên 12345 ... CuốiCuối
Kết quả 21 đến 30 của 128
  1. #21
    Ngày tham gia
    Apr 2015
    Bài viết
    0
    bài 1:
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#ff8000]/** to change this template, choose tools | templates* and open the template in the editor.*/[/color][color=#0000bb]package hello[/color][color=#007700].[/color][color=#0000bb]world[/color][color=#007700]; [/color][color=#ff8000]/**** @author nobita*/[/color][color=#007700]public class [/color][color=#0000bb]helloworld [/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]10[/color][color=#007700];[/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]11[/color][color=#007700];[/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]12[/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][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 chia 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]"phan du khi chia 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]"phan nguyen khi chia 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]"b%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]"c/2: "[/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]"c%3: "[/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]"gia tri moi cua cac so: "[/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] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: 10 điểm
    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 template, choose tools | templates* and open the template in the editor.*/[/color][color=#0000bb]package hello[/color][color=#007700].[/color][color=#0000bb]world[/color][color=#007700]; [/color][color=#ff8000]/**** @author nobita*/[/color][color=#007700]public class [/color][color=#0000bb]helloworld [/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]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]int d[/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 2ax+b = 8c voi a=1.1 b= 2.2 c=3.3"[/color][color=#007700]); [/color][color=#0000bb]a[/color][color=#007700]=[/color][color=#0000bb]1.1f[/color][color=#007700]; [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]2.2f[/color][color=#007700]; [/color][color=#0000bb]c[/color][color=#007700]=[/color][color=#0000bb]3.3f[/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 can tim: "[/color][color=#007700]+[/color][color=#0000bb]x[/color][color=#007700]);[/color][color=#0000bb]d[/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]"nghiem x sau khi ep kieu: "[/color][color=#007700]+[/color][color=#0000bb]d[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: bạn chưa loại trừ trường hợp a = 0
    8.5 điểm
    người chấm điểm: tiasangmoi

  2. #22
    Ngày tham gia
    Aug 2014
    Bài viết
    0
    Trích dẫn Gửi bởi tiasangmoi92
    về kết quả thì nó không khác nhau, nhưng xét về độ tối ưu code
    a = a+1 sẽ thực hiện 2 phép toán a+1 và gán a = a+1
    còn a++ thì thực hiện tăng chính nó lên 1, nên chỉ thực hiện duy nhất 1 phép toán

    Trích dẫn Gửi bởi vjrus.ht
    e xem video thì a+=1; tương đương với a= a+1 mà a. ở đây e muốn áp dụng cả 2 cách tăng giá trị của biến
    em nghĩ là khi dùng a++ nó chỉ tăng a lên,còn khi dùng a=a+1 khi áp dụng cho cho vòng lạp thi có thể in cả giá trị a,vừa tăng vừa gán

  3. #23
    Ngày tham gia
    May 2014
    Bài viết
    0
    bài 1
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

    </div>
    <div class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote>

    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#007700]public 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]a [/color][color=#007700]= [/color][color=#0000bb]11[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]27[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]45[/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 chia 2 lay nguyen 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]"b chia 2 lay nguyen 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]"c chia 2 lay nguyen 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]"achia 3 lay du 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]"b chia 3 lay du 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]"c chia 3 lay du 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]"so a,b,c sau khi tang lan luot la: " [/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] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: 10 điểm
    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]bài2 [/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]int songuyen[/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]22[/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]" gia tri cua x la: " [/color][color=#007700]+ [/color][color=#0000bb]x[/color][color=#007700]); [/color][color=#0000bb]songuyen [/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 sau khi ep la: " [/color][color=#007700]+ [/color][color=#0000bb]songuyen[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: bài chưa loại trừ trường hợp a = 0,
    nếu gán a = 0 chương trình sẽ lỗi
    9 điểm
    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]{ 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]a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700], [/color][color=#0000bb]s[/color][color=#007700], [/color][color=#0000bb]p[/color][color=#007700], [/color][color=#0000bb]k[/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]8[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]4[/color][color=#007700]; [/color][color=#0000bb]p [/color][color=#007700]= ([/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]) / [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]k [/color][color=#007700]= (float) ([/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]s [/color][color=#007700]= (float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]k[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"s= " [/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]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=#ff8000]// áp dụng định lí cosin [/color][color=#0000bb]b [/color][color=#007700]= ([/color][color=#0000bb]a [/color][color=#007700]* [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]* [/color][color=#0000bb]c [/color][color=#007700]- [/color][color=#0000bb]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]c [/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]"goc a co do lon la arccos " [/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]"goc b co do lon la arccos " [/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 c co do lon la arccos " [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]);[/color] 
    </blockquote></div>
    </div>
    </div>
    có thể do bạn vô tình không copy đủ code,
    nhưng mình sẽ không chấm điểm những bài có thiếu xót tương tự
    người chấm điểm: tiasangmoi

  4. #24
    Ngày tham gia
    Dec 2014
    Bài viết
    0
    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]pheptinhchia [/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]5[/color][color=#007700]; [/color][color=#0000bb]double b [/color][color=#007700]= [/color][color=#0000bb]6[/color][color=#007700]; [/color][color=#0000bb]double c [/color][color=#007700]=[/color][color=#0000bb]7[/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 cac so cho 2 la:"[/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]"/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=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]"/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=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]"/2 = "[/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=#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 cac so cho 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=#0000bb]a[/color][color=#007700]+([/color][color=#dd0000]"%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=#0000bb]b[/color][color=#007700]+([/color][color=#dd0000]"%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=#0000bb]c[/color][color=#007700]+([/color][color=#dd0000]"%3 = "[/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]""[/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 la: "[/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] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: hi bạn, đề bài yêu cầu a, b, c, là số nguyên, bạn lại dùng số thực, trong khi phép tính lấy phần nguyên ( / ) đó, chỉ áp dụng cho số nguyên, nếu là số thực nó là phép chia, bạn chạy thử có lẽ cũng nhận ra chỗ sai ấy ngay trên kết quả!
    5 điểm
    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]phuongtrinh [/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]0[/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]6[/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]"gia tri a phai khac 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]"gia tri truoc khi ep kieu:"[/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]"gia tri sau khi ep kieu"[/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] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: 10 điểm
    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]
    import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]tamgiac [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]scanner scan [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap cac canh cua tam giac: "[/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]double a [/color][color=#007700]= [/color][color=#0000bb]scan[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"b = "[/color][color=#007700]); [/color][color=#0000bb]double b [/color][color=#007700]= [/color][color=#0000bb]scan[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"c = "[/color][color=#007700]); [/color][color=#0000bb]double c [/color][color=#007700]= [/color][color=#0000bb]scan[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700](); [/color][color=#0000bb]double dt [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700]; if(([/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700])>[/color][color=#0000bb]c [/color][color=#007700]&& ([/color][color=#0000bb]a[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700])>[/color][color=#0000bb]b [/color][color=#007700]&& ([/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700])>[/color][color=#0000bb]a[/color][color=#007700]){ [/color][color=#0000bb]double 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]dt [/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: "[/color][color=#007700]+[/color][color=#0000bb]dt[/color][color=#007700]); [/color][color=#0000bb]double sinc [/color][color=#007700]= [/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]dt[/color][color=#007700]/([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]); [/color][color=#0000bb]double sinb [/color][color=#007700]= [/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]dt[/color][color=#007700]/([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]); [/color][color=#0000bb]double sina [/color][color=#007700]= [/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]dt[/color][color=#007700]/([/color][color=#0000bb]c[/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 = "[/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=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"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=#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]"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][color=#dd0000]" rad"[/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]"3 so ban nhap khong phai la 3 canh cua tam giac"[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: công thức tính góc của bạn không chính xác với trường hợp
    tam giác có góc tù. bạn nên dùng hàm để đổi thành độ thay vì để rad.
    tham khảo bài các bạn đã nộp ở trên để tìm lỗi sai.
    5 điểm.
    người chấm điểm: tiasangmoi
    hi bạn, lần sau bạn không nên post ra nhiều bình luận như vậy, gộp vào 1 bài như này là được ,nên chèn vào thẻ php để code dễ nhìn [bqt]

  5. #25
    Ngày tham gia
    Mar 2014
    Bài viết
    0
    Trích dẫn Gửi bởi thanhdatkma
    bài 1

    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]{ 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]a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700], [/color][color=#0000bb]s[/color][color=#007700], [/color][color=#0000bb]p[/color][color=#007700], [/color][color=#0000bb]k[/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]8[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]4[/color][color=#007700]; [/color][color=#0000bb]p [/color][color=#007700]= ([/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]) / [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]k [/color][color=#007700]= (float) ([/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]s [/color][color=#007700]= (float) [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]k[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"s= " [/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]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=#ff8000]// áp dụng định lí cosin [/color][color=#0000bb]b [/color][color=#007700]= ([/color][color=#0000bb]a [/color][color=#007700]* [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#0000bb]c [/color][color=#007700]* [/color][color=#0000bb]c [/color][color=#007700]- [/color][color=#0000bb]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]c [/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]"goc a co do lon la arccos " [/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]"goc b co do lon la arccos " [/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 c co do lon la arccos " [/color][color=#007700]+ [/color][color=#0000bb]c[/color][color=#007700]);[/color] 
    </blockquote></div>
    </div>
    </div>
    trong netbean có công thức tính arc cos nhé. bài yêu cầu tìm số đo 3 góc

  6. #26
    Ngày tham gia
    Jan 2015
    Bài viết
    0
    bạn


    Trích dẫn Gửi bởi vjrus.ht
    trong netbean có công thức tính arc cos nhé. bài yêu cầu tìm số đo 3 góc
    bạn virut.ht: .còn hàm đấy người mới dùng không phải ai cũng biết,còn về mặt toán học thì nó không sai

  7. #27
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    Trích dẫn Gửi bởi thanhdatkma
    em nghĩ là khi dùng a++ nó chỉ tăng a lên,còn khi dùng a=a+1 khi áp dụng cho cho vòng lạp thi có thể in cả giá trị a,vừa tăng vừa gán
    em xem lại video rồi chạy thử đoạn code này để biết a++ trong vòng lặp


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#007700]public class [/color][color=#0000bb]vidu [/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]; for ([/color][color=#0000bb]a[/color][color=#007700]=[/color][color=#0000bb]1[/color][color=#007700];[/color][color=#0000bb]a[/color][color=#007700]<=[/color][color=#0000bb]10[/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]"a = "[/color][color=#007700]+[/color][color=#0000bb]a[/color][color=#007700]); } }}[/color] 

  8. #28
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    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]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]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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"a lay nguyen voi 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]"b lay nguyen voi 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]"c lay nguyen voi 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]"a lay du voi 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]"b lay du voi 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]"c lay du voi 3 la: "[/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]"a tang len 1: "[/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 tang len 1: "[/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 tang len 1: "[/color][color=#007700]+(++[/color][color=#0000bb]c[/color][color=#007700])); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: 10 điểm
    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]bai2[/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]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 float la: "[/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 int la: "[/color][color=#007700]+(int)[/color][color=#0000bb]x[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: do bài bạn chưa loại trừ trường hợp a = 0
    8.5 điểm
    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]bai3[/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]chuvi[/color][color=#007700],[/color][color=#0000bb]dientich[/color][color=#007700]; [/color][color=#0000bb]chuvi [/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 cua tam giac la: "[/color][color=#007700]+[/color][color=#0000bb]dientich[/color][color=#007700]); [/color][color=#0000bb]double goca[/color][color=#007700], [/color][color=#0000bb]gocb[/color][color=#007700], [/color][color=#0000bb]gocc[/color][color=#007700]; [/color][color=#0000bb]goca [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]dientich[/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]gocb [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]dientich[/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]gocc [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]dientich[/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]"so do cua goc a la: "[/color][color=#007700]+[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]goca[/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 goc b la: "[/color][color=#007700]+[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]gocb[/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 goc c la: "[/color][color=#007700]+[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]gocc[/color][color=#007700])); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: chuvi bạn ghi làm gì?, p bạn chưa khai báo, bạn nên test kỹ bài rồi đăng. có thể chỉ do bạn nhầm lẫn chút!
    với trường hợp tam giác tù, cách tính góc của bạn sẽ không cho kết quả chính xác. bạn tham khảo bài của các bạn đã đăng để hiểu chỗ này!
    4 điểm
    người chấm: tiasangmoi

  9. #29
    Ngày tham gia
    Nov 2014
    Bài viết
    0
    Trích dẫn Gửi bởi trần văn chiến
    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]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]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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"a lay nguyen voi 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]"b lay nguyen voi 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]"c lay nguyen voi 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]"a lay du voi 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]"b lay du voi 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]"c lay du voi 3 la: "[/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]"a tang len 1: "[/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 tang len 1: "[/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 tang len 1: "[/color][color=#007700]+(++[/color][color=#0000bb]c[/color][color=#007700])); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: 10 điểm
    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]bai2[/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]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 float la: "[/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 int la: "[/color][color=#007700]+(int)[/color][color=#0000bb]x[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: do bài bạn chưa loại trừ trường hợp a = 0
    8.5 điểm
    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]bai3[/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]chuvi[/color][color=#007700],[/color][color=#0000bb]dientich[/color][color=#007700]; [/color][color=#0000bb]chuvi [/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 cua tam giac la: "[/color][color=#007700]+[/color][color=#0000bb]dientich[/color][color=#007700]); [/color][color=#0000bb]double goca[/color][color=#007700], [/color][color=#0000bb]gocb[/color][color=#007700], [/color][color=#0000bb]gocc[/color][color=#007700]; [/color][color=#0000bb]goca [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]dientich[/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]gocb [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]dientich[/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]gocc [/color][color=#007700]= [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]asin[/color][color=#007700]([/color][color=#0000bb]dientich[/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]"so do cua goc a la: "[/color][color=#007700]+[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]goca[/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 goc b la: "[/color][color=#007700]+[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]gocb[/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 goc c la: "[/color][color=#007700]+[/color][color=#0000bb]todegrees[/color][color=#007700]([/color][color=#0000bb]gocc[/color][color=#007700])); }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: chuvi bạn ghi làm gì?, p bạn chưa khai báo, bạn nên test kỹ bài rồi đăng. có thể chỉ do bạn nhầm lẫn chút!
    với trường hợp tam giác tù, cách tính góc của bạn sẽ không cho kết quả chính xác. bạn tham khảo bài của các bạn đã đăng để hiểu chỗ này!
    4 điểm
    người chấm: tiasangmoi
    ok

  10. #30
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    bài 1:


    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=#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]6[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]7[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"phần nguyên khi chia a, b, c cho 2 lần lượt là: " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700]/[/color][color=#0000bb]2 [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2 [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/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=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"phần dư khi chia a, b, ,c cho 3 lần lượt là: "[/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]3 [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700]%[/color][color=#0000bb]3 [/color][color=#007700]+ [/color][color=#dd0000]"\t" [/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=#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]"
    giá trị a, b, c sau khi tăng 1 là: " [/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=#dd0000]"
    "[/color][color=#007700]); }}[/color] 
    chấm điểm: 10 điểm!
    bài 2:


    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=#0000bb]float x[/color][color=#007700], [/color][color=#0000bb]a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]2.1f[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]3.5f[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]4.5f[/color][color=#007700]; [/color][color=#0000bb]x [/color][color=#007700]= (float)([/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].print([/color][color=#dd0000]"giá trị của x = " [/color][color=#007700]+ [/color][color=#0000bb]x [/color][color=#007700]+ [/color][color=#dd0000]"
    "[/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].print([/color][color=#dd0000]"giá trị của x sau khi ép kiểu = " [/color][color=#007700]+ [/color][color=#0000bb]x [/color][color=#007700]+ [/color][color=#dd0000]"
    "[/color][color=#007700]); }}[/color] 
    chấm điểm: do bạn chưa loại th a = 0
    9 điểm
    bài 3:


    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=#0000bb]float a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700], [/color][color=#0000bb]s[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]3f[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]4f[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]5f[/color][color=#007700]; [/color][color=#0000bb]float p [/color][color=#007700]= (float)([/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].print([/color][color=#dd0000]"diện tích tam giác abc : " [/color][color=#007700]+ [/color][color=#0000bb]s [/color][color=#007700]+ [/color][color=#dd0000]"
    "[/color][color=#007700]); [/color][color=#0000bb]double 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]double 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]double c [/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]a[/color][color=#007700]*[/color][color=#0000bb]a [/color][color=#007700]- [/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700])/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700])); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/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]a[/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]b[/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]c[/color][color=#007700]) + [/color][color=#dd0000]" độ
    "[/color][color=#007700]); }}[/color] 
    chấm điểm: 10 điểm
    công thức tính góc mình tham khảo từ các bạn. mình tìm hoài mà không thấy.
    mong ad chấm dùm. :">

    người chấm điểm: tiasangmoi

Trang 3 của 13 Đầu tiênĐầu tiên 12345 ... CuốiCuối

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •