Trang 2 của 9 Đầu tiênĐầu tiên 1234 ... CuốiCuối
Kết quả 11 đến 20 của 87
  1. #11
    Ngày tham gia
    Apr 2016
    Bài viết
    0
    Trích dẫn Gửi bởi fannt
    câu 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]agrs[/color][color=#007700]) { [/color][color=#0000bb]float a [/color][color=#007700]= [/color][color=#0000bb]3[/color][color=#007700]; [/color][color=#0000bb]float b [/color][color=#007700]= [/color][color=#0000bb]4[/color][color=#007700]; [/color][color=#0000bb]float c [/color][color=#007700]= [/color][color=#0000bb]5[/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]b[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700])>[/color][color=#0000bb]a[/color][color=#007700]) { if ([/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]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]","[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]" la do dai 3 canh cua 1 tam giac deu"[/color][color=#007700]); } else if(([/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]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]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]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]) ) { if ([/color][color=#0000bb]a[/color][color=#007700]==[/color][color=#0000bb]b[/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]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]","[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]" la do dai 3 canh cua 1 tam giac vuong can"[/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=#0000bb]a[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]" la do dai 3 canh cua 1 tam giac vuong"[/color][color=#007700]); } } else if([/color][color=#0000bb]a[/color][color=#007700]==[/color][color=#0000bb]b[/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]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]","[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]" la do dai 3 canh cua 1 tam giac can"[/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=#0000bb]a[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]" la do dai 3 canh cua 1 tam giac thuong"[/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=#0000bb]a[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#dd0000]","[/color][color=#007700]+[/color][color=#0000bb]c[/color][color=#007700]+[/color][color=#dd0000]" khong phai so do 3 canh cua 1 tam giac"[/color][color=#007700]); } }[/color] 
    </blockquote></div>
    </div>
    </div>
    câu 2 này bạn có cho ra được kết quả là hình tam giác vuông cân không

  2. #12
    Ngày tham gia
    Jul 2015
    Bài viết
    0
    câu 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]bai5_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]a[/color][color=#007700]=[/color][color=#0000bb]50[/color][color=#007700]; if ([/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]5 [/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]"a = " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]" chia het cho 5"[/color][color=#007700]); } else{ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"a = " [/color][color=#007700]+ [/color][color=#0000bb]a [/color][color=#007700]+ [/color][color=#dd0000]" khong chia het cho 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/5 = " [/color][color=#007700]+ ([/color][color=#0000bb]a[/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 chia 5 du " [/color][color=#007700]+ ([/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]5[/color][color=#007700])); } }}[/color] 
    </blockquote></div>
    </div>
    </div>
    câu 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]bai5_2 [/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]/* * cho trước độ dài 3 cạnh(số thực, cả âm và dương) * kiểm tra đó có phải là tam giác không. nếu có là tam giác gì? */ [/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]5[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]2[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]7[/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]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]a [/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]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]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]"đây là một tam giác"[/color][color=#007700]); if ([/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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"đây là tam giác đều."[/color][color=#007700]); } else if( [/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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"đây là tam giác cân"[/color][color=#007700]); } else if( ((double)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]) == (double)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/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])) || ((double)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b[/color][color=#007700]) == (double)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/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])) || ((double)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]c[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]) == (double)[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"đây là tam giác vuông"[/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]"đây là tam giac thường"[/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]"đây không phải là một tam giác"[/color][color=#007700]); } }}[/color] 
    </blockquote></div>
    </div>
    </div>
    câu 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]bai5_3 [/color][color=#007700]{ [/color][color=#ff8000]/* * giải phương trình bậc 2: a * x^2 + b*x + c = 0, a,b,c là số thực */ [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]float a[/color][color=#007700], [/color][color=#0000bb]b[/color][color=#007700], [/color][color=#0000bb]c[/color][color=#007700], [/color][color=#0000bb]x[/color][color=#007700]; [/color][color=#0000bb]a [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700]; [/color][color=#0000bb]b [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]0[/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]0[/color][color=#007700]){ if([/color][color=#0000bb]c[/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]"phương trình có vô số nghiệm"[/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]"phương trình vô nghiệm"[/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]"phương trình đã cho có 1 nghiệm duy nhất x = " [/color][color=#007700]+ (-[/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]b[/color][color=#007700])); } } else{ if(([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b [/color][color=#007700]- [/color][color=#0000bb]4[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/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]"phương trình có một nghiệm kép: x = " [/color][color=#007700]+ (-[/color][color=#0000bb]b[/color][color=#007700]/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]))); } else if(([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b [/color][color=#007700]- [/color][color=#0000bb]4[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/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]"phương trình đã cho vô nghiệm"[/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]"phương trình có 2 nghiệm phân biệt x1 = " [/color][color=#007700]+ ((-[/color][color=#0000bb]b[/color][color=#007700]-(double)([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b [/color][color=#007700]- [/color][color=#0000bb]4[/color][color=#007700]*[/color][color=#0000bb]a[/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=#dd0000]"và x2 = " [/color][color=#007700]+ ((-[/color][color=#0000bb]b[/color][color=#007700]+(double)([/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b [/color][color=#007700]- [/color][color=#0000bb]4[/color][color=#007700]*[/color][color=#0000bb]a[/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] 
    </blockquote></div>
    </div>
    </div>
    bạn tiasangmoi92 và các bạn góp ý giúp mình với
    thanks !

  3. #13
    Ngày tham gia
    Apr 2016
    Bài viết
    0
    bài 1 của e
    <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><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) {[/size]
          int a = 10000;
          if (a%5==0){
              system.out.println("a la so chia het cho 5");
          }else{
                system.out.println("a khong chia het cho 5");
                system.out.println("thuong a/5: "+a/5);
                system.out.println("so du a/5: "+a%5);
    }
       
        }
    [size=15px][size=15px]}
    </blockquote></div>
    </div>
    </div>[/size]

  4. #14
    Ngày tham gia
    Apr 2016
    Bài viết
    0
    bài 1 của e
    <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><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) {[/size]
     
          int a = 10000;
     
          if (a%5==0){
     
              system.out.println("a la so chia het cho 5");
     
          }else{
     
                system.out.println("a khong chia het cho 5");
     
                system.out.println("thuong a/5: "+a/5);
     
                system.out.println("so du a/5: "+a%5);
     
    }
     
     
     
        }
    <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></blockquote></div>
    </div>
    </div>

  5. #15
    Ngày tham gia
    Feb 2015
    Bài viết
    0
    bài 2 của e
    <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) {
            double a= 3, b=4, c=5;
            if (a + b > c && a + c > b && b + c > a) {
                system.out.println("a, b, c là độ dài của giác tam giác");
            }else{
                system.out.println("a, b, c không phải là độ dài của một tam giác");}
            if (a == b || a == c || b == c){
                system.out.println("a, b, c là độ dài của một tam giác cân");}
            if (a == b && a == c){
                system.out.println("a, b, c là độ dài của một tam giác đều");}
            if (a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b){
                system.out.println("a, b, c là độ dài của một tam giác vuông");}
       
        }
    </blockquote></div>
    </div>
    </div>
    bài 3 của e
    <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 giaiptbac2 {
        public static void main(string[] args) {
            double a, b, c, x1, x2, x, delta;
            a = 5;
            b = -1;
            c = 19;
            if (a == 0){
                x = (0-c)/b;
                system.out.println("nghiệm của phương trình là: "+ x);
            }else{
                delta = b*b - 4*a*c;
                if (delta < 0){ system.out.println("phương trình vô nghiệm");}
                if (delta == 0){
                    x1 = x2 = -a / 2*b;
                    system.out.println("phương trình có nghiệm x1 = x2 = "+ delta);}
                if (delta > 0){
                    x1 = (-b + math.sqrt(delta)) / 2*a;
                    x2 = (-b - math.sqrt(delta)) / 2*a;
                    system.out.println("phương trình có nghiệm x1= "+ x1 +", x2= "+ x2);}
                }
            }
        }
    </blockquote></div>
    </div>
    </div>

  6. #16
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    Trích dẫn Gửi bởi hahuu
    câu 2 này bạn có cho ra được kết quả là hình tam giác vuông cân không
    ko bạn ạ, mình ko hiểu sao ko ra dc, nó toàn hiện tam giác cân thôi

  7. #17
    Ngày tham gia
    Nov 2014
    Bài viết
    0
    câu 3:


    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=#ff8000]//giai pt bac 2 ax^2 + bx + c = 0 [/color][color=#0000bb]int a[/color][color=#007700],[/color][color=#0000bb]b[/color][color=#007700],[/color][color=#0000bb]cdelta[/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]4[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]= [/color][color=#0000bb]3[/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]"không phải pt bậc 2 và có nghiệm là:"[/color][color=#007700]+ -[/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]b[/color][color=#007700]); }else{ [/color][color=#0000bb]delta[/color][color=#007700]=[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqr[/color][color=#007700]([/color][color=#0000bb]b[/color][color=#007700]) - [/color][color=#0000bb]4[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]; if([/color][color=#0000bb]delta[/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]"pt có 2 nghiệm:"[/color][color=#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]"nghiệm x1:"[/color][color=#007700]+ (-[/color][color=#0000bb]b[/color][color=#007700]-[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]delta[/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]"nghiệm x2:"[/color][color=#007700]+ (-[/color][color=#0000bb]b[/color][color=#007700]+[/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]delta[/color][color=#007700])/[/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700])); }else{ if ([/color][color=#0000bb]delta[/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]"pt có nghiệm kép là:"[/color][color=#007700]+ [/color][color=#0000bb]b[/color][color=#007700]/[/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]); }else{ if ([/color][color=#0000bb]delta[/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]"pt vô nghiệm!"[/color][color=#007700]); } } } } }}[/color] 
    nhưng không chạy được

  8. #18
    Ngày tham gia
    Aug 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 class="quotecontent">
    <div class="bbcm_spoiler_noscript"><blockquote></blockquote></div>
    </div>
    </div></div><div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].*;class [/color][color=#0000bb]chiahet [/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]6 [/color][color=#007700], [/color][color=#0000bb]y [/color][color=#007700],[/color][color=#0000bb]x[/color][color=#007700]; if([/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]5[/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]"a chia het cho 5 "[/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]"thuong = "[/color][color=#007700]+(float)+[/color][color=#0000bb]a[/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]"so du = " [/color][color=#007700]+(int)+[/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]5[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>

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

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#007700]public class [/color][color=#0000bb]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]16[/color][color=#007700]; if([/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]5[/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]"a chia het cho 5"[/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]"thuong la: " [/color][color=#007700]+ [/color][color=#0000bb]a[/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]"so du la: " [/color][color=#007700]+ [/color][color=#0000bb]a[/color][color=#007700]%[/color][color=#0000bb]5[/color][color=#007700]); } }}[/color] 
    </blockquote></div>
    </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]{ 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]3[/color][color=#007700]; [/color][color=#0000bb]double b [/color][color=#007700]= [/color][color=#0000bb]3[/color][color=#007700]; [/color][color=#0000bb]double c [/color][color=#007700]= [/color][color=#0000bb]5[/color][color=#007700]; if([/color][color=#0000bb]a[/color][color=#007700]<= [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]b [/color][color=#007700]<= [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]c [/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]"a, b, c khong phai canh tam giac"[/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]b [/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]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]"a, b, c khong phai canh tam giac"[/color][color=#007700]); }else { if ([/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]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]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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"la tam giac vuong"[/color][color=#007700]); } if([/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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"la tam giac deu"[/color][color=#007700]); } if([/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]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"la tam giac can"[/color][color=#007700]); } } }}[/color] 
    </blockquote></div>
    </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]{ 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]1[/color][color=#007700]; [/color][color=#0000bb]double b [/color][color=#007700]= [/color][color=#0000bb]4[/color][color=#007700]; [/color][color=#0000bb]double c [/color][color=#007700]= [/color][color=#0000bb]2[/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]"day khong phai phuong trinh bac 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]"nghiem la: " [/color][color=#007700]+ (-[/color][color=#0000bb]c[/color][color=#007700]/[/color][color=#0000bb]b[/color][color=#007700])); }else { [/color][color=#0000bb]double delta [/color][color=#007700]= [/color][color=#0000bb]b[/color][color=#007700]*[/color][color=#0000bb]b [/color][color=#007700]- [/color][color=#0000bb]4[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]*[/color][color=#0000bb]c[/color][color=#007700]; if([/color][color=#0000bb]delta [/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 co 1 nghiem: " [/color][color=#007700]+ (-[/color][color=#0000bb]b[/color][color=#007700]/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/color][color=#007700]))); }else { if([/color][color=#0000bb]delta[/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]"nghiem x1: " [/color][color=#007700]+ ((-[/color][color=#0000bb]b [/color][color=#007700]+ [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]delta[/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 x2: " [/color][color=#007700]+ ((-[/color][color=#0000bb]b [/color][color=#007700]- [/color][color=#0000bb]math[/color][color=#007700].[/color][color=#0000bb]sqrt[/color][color=#007700]([/color][color=#0000bb]delta[/color][color=#007700]))/([/color][color=#0000bb]2[/color][color=#007700]*[/color][color=#0000bb]a[/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 vo nghiem"[/color][color=#007700]); } } } }}[/color] 
    </blockquote></div>
    </div>
    </div>

  10. #20
    Ngày tham gia
    Apr 2014
    Bài viết
    0
    mình ơi tam giác thường đâu

Trang 2 của 9 Đầu tiênĐầu tiên 1234 ... 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
  •