Trang 2 của 13 Đầu tiênĐầu tiên 123412 ... CuốiCuối
Kết quả 11 đến 20 của 124
  1. #11
    Ngày tham gia
    May 2015
    Bài viết
    0
    mình nghĩ ide của mình có vđề. với code như này mà nhập age = 0 nó vẫn chạy tiếp là sao nhỉ. hichic

    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    package infostudent[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]infostudent [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args */ [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#ff8000]// todo auto-generated method stub [/color][color=#0000bb]student std1 [/color][color=#007700]= new [/color][color=#0000bb]student[/color][color=#007700](); [/color][color=#0000bb]std1[/color][color=#007700].[/color][color=#0000bb]enter[/color][color=#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]"hoc luc: " [/color][color=#007700]+ [/color][color=#0000bb]std1[/color][color=#007700].[/color][color=#0000bb]hocluc[/color][color=#007700]() ); } } class [/color][color=#0000bb]student [/color][color=#007700]{ public [/color][color=#0000bb]string name[/color][color=#007700]; [/color][color=#0000bb]float diemtoan[/color][color=#007700], [/color][color=#0000bb]diemly[/color][color=#007700], [/color][color=#0000bb]diemhoa[/color][color=#007700], [/color][color=#0000bb]trungbinh[/color][color=#007700]; [/color][color=#0000bb]int age[/color][color=#007700]; public [/color][color=#0000bb]void enter[/color][color=#007700](){ [/color][color=#0000bb]scanner input [/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].print([/color][color=#dd0000]"name: "[/color][color=#007700]); [/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"age: "[/color][color=#007700]); [/color][color=#0000bb]age [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem toan: "[/color][color=#007700]); [/color][color=#0000bb]diemtoan [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem ly: "[/color][color=#007700]); [/color][color=#0000bb]diemly [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem hoa: "[/color][color=#007700]); [/color][color=#0000bb]diemhoa [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if ([/color][color=#0000bb]age [/color][color=#007700]< [/color][color=#0000bb]1[/color][color=#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]"input wrong!"[/color][color=#007700]); else if ([/color][color=#0000bb]diemtoan [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemtoan [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]diemly [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemly [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]diemhoa [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemhoa [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#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]"input again!"[/color][color=#007700]); } else { [/color][color=#0000bb]trungbinh [/color][color=#007700]= ([/color][color=#0000bb]diemtoan [/color][color=#007700]+ [/color][color=#0000bb]diemhoa [/color][color=#007700]+ [/color][color=#0000bb]diemly[/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]"gpa = " [/color][color=#007700]+ [/color][color=#0000bb]trungbinh[/color][color=#007700]); } } public [/color][color=#0000bb]string hocluc[/color][color=#007700](){ if ([/color][color=#0000bb]trungbinh [/color][color=#007700]>= [/color][color=#0000bb]8[/color][color=#007700]) return [/color][color=#dd0000]"gioi"[/color][color=#007700]; else if ([/color][color=#0000bb]trungbinh [/color][color=#007700]>=[/color][color=#0000bb]6.5[/color][color=#007700]) return [/color][color=#dd0000]"kha"[/color][color=#007700]; else if ([/color][color=#0000bb]trungbinh [/color][color=#007700]>=[/color][color=#0000bb]5[/color][color=#007700]) return [/color][color=#dd0000]"trung binh"[/color][color=#007700]; return [/color][color=#dd0000]"yeu"[/color][color=#007700]; } }[/color] 
    </blockquote></div>
    </div>
    </div>

  2. #12
    Ngày tham gia
    Apr 2015
    Bài viết
    0
    Trích dẫn Gửi bởi dr.v
    mình nghĩ ide của mình có vđề. với code như này mà nhập age = 0 nó vẫn chạy tiếp là sao nhỉ. hichic

    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    package infostudent[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; public class [/color][color=#0000bb]infostudent [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args */ [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#ff8000]// todo auto-generated method stub [/color][color=#0000bb]student std1 [/color][color=#007700]= new [/color][color=#0000bb]student[/color][color=#007700](); [/color][color=#0000bb]std1[/color][color=#007700].[/color][color=#0000bb]enter[/color][color=#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]"hoc luc: " [/color][color=#007700]+ [/color][color=#0000bb]std1[/color][color=#007700].[/color][color=#0000bb]hocluc[/color][color=#007700]() ); } } class [/color][color=#0000bb]student [/color][color=#007700]{ public [/color][color=#0000bb]string name[/color][color=#007700]; [/color][color=#0000bb]float diemtoan[/color][color=#007700], [/color][color=#0000bb]diemly[/color][color=#007700], [/color][color=#0000bb]diemhoa[/color][color=#007700], [/color][color=#0000bb]trungbinh[/color][color=#007700]; [/color][color=#0000bb]int age[/color][color=#007700]; public [/color][color=#0000bb]void enter[/color][color=#007700](){ [/color][color=#0000bb]scanner input [/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].print([/color][color=#dd0000]"name: "[/color][color=#007700]); [/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"age: "[/color][color=#007700]); [/color][color=#0000bb]age [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem toan: "[/color][color=#007700]); [/color][color=#0000bb]diemtoan [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem ly: "[/color][color=#007700]); [/color][color=#0000bb]diemly [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"diem hoa: "[/color][color=#007700]); [/color][color=#0000bb]diemhoa [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if ([/color][color=#0000bb]age [/color][color=#007700]< [/color][color=#0000bb]1[/color][color=#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]"input wrong!"[/color][color=#007700]); else if ([/color][color=#0000bb]diemtoan [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemtoan [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]diemly [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemly [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]diemhoa [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemhoa [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#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]"input again!"[/color][color=#007700]); } else { [/color][color=#0000bb]trungbinh [/color][color=#007700]= ([/color][color=#0000bb]diemtoan [/color][color=#007700]+ [/color][color=#0000bb]diemhoa [/color][color=#007700]+ [/color][color=#0000bb]diemly[/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]"gpa = " [/color][color=#007700]+ [/color][color=#0000bb]trungbinh[/color][color=#007700]); } } public [/color][color=#0000bb]string hocluc[/color][color=#007700](){ if ([/color][color=#0000bb]trungbinh [/color][color=#007700]>= [/color][color=#0000bb]8[/color][color=#007700]) return [/color][color=#dd0000]"gioi"[/color][color=#007700]; else if ([/color][color=#0000bb]trungbinh [/color][color=#007700]>=[/color][color=#0000bb]6.5[/color][color=#007700]) return [/color][color=#dd0000]"kha"[/color][color=#007700]; else if ([/color][color=#0000bb]trungbinh [/color][color=#007700]>=[/color][color=#0000bb]5[/color][color=#007700]) return [/color][color=#dd0000]"trung binh"[/color][color=#007700]; return [/color][color=#dd0000]"yeu"[/color][color=#007700]; } }[/color] 
    </blockquote></div>
    </div>
    </div>
    đơn giản vì cái phương thưc hocluc của bạn không có đoạn xử lý liên quan tới tuổi, nên nó vẫn chạy thôi! :d

  3. #13
    Ngày tham gia
    Dec 2014
    Bài viết
    0
    Mã nguồn PHP:
    [color=#000000]
    exception in thread [/color][color=#dd0000]"main" [/color][color=#0000bb]java[/color][color=#007700].[/color][color=#0000bb]lang[/color][color=#007700].[/color][color=#0000bb]error[/color][color=#007700]: [/color][color=#0000bb]unresolved compilation problem[/color][color=#007700]: [/color][color=#0000bb]at intro[/color][color=#007700].[/color][color=#0000bb]core[/color][color=#007700].[/color][color=#0000bb]baitap7[/color][color=#007700].[/color][color=#0000bb]main[/color][color=#007700]([/color][color=#0000bb]baitap7[/color][color=#007700].[/color][color=#0000bb]java[/color][color=#007700]:[/color][color=#0000bb]7[/color][color=#007700])[/color] 
    lỗi này là sao vậy anh

  4. #14
    Ngày tham gia
    Jan 2015
    Bài viết
    0
    Trích dẫn Gửi bởi shinkudo271

    Mã nguồn PHP:
    [color=#000000]
    exception in thread [/color][color=#dd0000]"main" [/color][color=#0000bb]java[/color][color=#007700].[/color][color=#0000bb]lang[/color][color=#007700].[/color][color=#0000bb]error[/color][color=#007700]: [/color][color=#0000bb]unresolved compilation problem[/color][color=#007700]: [/color][color=#0000bb]at intro[/color][color=#007700].[/color][color=#0000bb]core[/color][color=#007700].[/color][color=#0000bb]baitap7[/color][color=#007700].[/color][color=#0000bb]main[/color][color=#007700]([/color][color=#0000bb]baitap7[/color][color=#007700].[/color][color=#0000bb]java[/color][color=#007700]:[/color][color=#0000bb]7[/color][color=#007700])[/color] 
    lỗi này là sao vậy anh
    cái này hình như do ide, thỉnh thoảng mình cũng bị, tạo project khác lại không sao! :d
    bạn up toàn bộ code project lên mình coi xem!

  5. #15
    Ngày tham gia
    Apr 2015
    Bài viết
    0
    bác nào dảnh xem bài giúp em nhé!!!
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#ff8000]/** to change this template, choose tools | templates* and open the template in the editor.*/[/color][color=#0000bb]package bai4[/color][color=#007700]; [/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700]; [/color][color=#ff8000]//từ màn hình console, nhập dữ liệu của 1 sinh viên là họ và tên, năm sinh, điểm toán, lý , hóa (kiểu số thực).//dựa vào điểm trung bình 3 môn in ra đó là học sinh giỏi, khá hay trung bình[/color][color=#007700]public class [/color][color=#0000bb]bai4 [/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 in[/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]"nhâp họ tên sinh viên :"[/color][color=#007700]); [/color][color=#0000bb]string ten[/color][color=#007700]; [/color][color=#0000bb]ten[/color][color=#007700]=[/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#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]"/n"[/color][color=#007700]+[/color][color=#dd0000]"nhập năm sinh : "[/color][color=#007700]); [/color][color=#0000bb]int tuoi[/color][color=#007700]; [/color][color=#0000bb]tuoi[/color][color=#007700]=[/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#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]"/n"[/color][color=#007700]+[/color][color=#dd0000]"nhập điểm môn toán lý hóa : "[/color][color=#007700]); [/color][color=#0000bb]float a[/color][color=#007700]; [/color][color=#0000bb]a[/color][color=#007700]=[/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]float b[/color][color=#007700]; [/color][color=#0000bb]b[/color][color=#007700]=[/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]float c[/color][color=#007700]; [/color][color=#0000bb]c [/color][color=#007700]=[/color][color=#0000bb]in[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if([/color][color=#0000bb]tuoi[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| ([/color][color=#0000bb]a[/color][color=#007700]<[/color][color=#0000bb]0[/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]0[/color][color=#007700]&&[/color][color=#0000bb]b[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#007700])||([/color][color=#0000bb]c[/color][color=#007700]<[/color][color=#0000bb]0[/color][color=#007700]&&[/color][color=#0000bb]c[/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#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ạn nhập sai năm sinh "[/color][color=#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]"điểm phải thuộc khoảng 1-10"[/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]"ho ve ten:"[/color][color=#007700]+[/color][color=#0000bb]ten[/color][color=#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]"nam sinh"[/color][color=#007700]+[/color][color=#0000bb]tuoi[/color][color=#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]"điểm môn toán "[/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]"điểm môn lý "[/color][color=#007700]+[/color][color=#0000bb]b[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"điểm môn hóa "[/color][color=#007700]+[/color][color=#0000bb]c [/color][color=#007700]); } [/color][color=#0000bb]float tb[/color][color=#007700]; [/color][color=#0000bb]tb [/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]3[/color][color=#007700]; if([/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]5 [/color][color=#007700]&& [/color][color=#0000bb]tb[/color][color=#007700]<[/color][color=#0000bb]6.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]"đạt học sinh trung bình "[/color][color=#007700]); }else{ if([/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]6.5 [/color][color=#007700]&& [/color][color=#0000bb]tb[/color][color=#007700]<[/color][color=#0000bb]8 [/color][color=#007700]){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"đạt học sinh khá "[/color][color=#007700]); }else{ if([/color][color=#0000bb]tb[/color][color=#007700]>=[/color][color=#0000bb]8[/color][color=#007700]){ [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"đạt học sinh giỏi "[/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]"hoc sinh kém"[/color][color=#007700]); } } } } }[/color] 
    </blockquote></div>
    </div>
    </div>

  6. #16
    Ngày tham gia
    Apr 2016
    Bài viết
    0
    xuanthu: bài bạn làm chuẩn rồi nhé! :d

  7. #17
    Ngày tham gia
    Apr 2015
    Bài viết
    0
    đây là bài của mình. ko hiểu sao bay hết lùi đầu dòng đi thế nhỉ???


    Mã nguồn PHP:
    [color=#000000]
    package basic[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]inputmismatchexception[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]inputoutputonconsole [/color][color=#007700]{private [/color][color=#0000bb]scanner input[/color][color=#007700];private [/color][color=#0000bb]string firstname[/color][color=#007700];private [/color][color=#0000bb]string secondname[/color][color=#007700];private [/color][color=#0000bb]int markofmathematic[/color][color=#007700];private [/color][color=#0000bb]int markofphysic[/color][color=#007700];private [/color][color=#0000bb]int markofchemistry[/color][color=#007700];[/color][color=#ff8000]// constructor[/color][color=#007700]public [/color][color=#0000bb]inputoutputonconsole[/color][color=#007700](){[/color][color=#0000bb]input [/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].print( [/color][color=#dd0000]"enter first name: " [/color][color=#007700]);[/color][color=#0000bb]firstname [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]();[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print( [/color][color=#dd0000]"enter second name: " [/color][color=#007700]);[/color][color=#0000bb]secondname [/color][color=#007700]= [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]();[/color][color=#0000bb]markofmathematic [/color][color=#007700]= [/color][color=#0000bb]inputmark[/color][color=#007700]( [/color][color=#dd0000]"mathematic" [/color][color=#007700]);[/color][color=#0000bb]markofphysic [/color][color=#007700]= [/color][color=#0000bb]inputmark[/color][color=#007700]( [/color][color=#dd0000]"physic" [/color][color=#007700]);[/color][color=#0000bb]markofchemistry [/color][color=#007700]= [/color][color=#0000bb]inputmark[/color][color=#007700]( [/color][color=#dd0000]"chemistry" [/color][color=#007700]);}[/color][color=#ff8000]// handling exception by entering marks[/color][color=#007700]private [/color][color=#0000bb]int inputmark[/color][color=#007700]( [/color][color=#0000bb]string str [/color][color=#007700]){[/color][color=#0000bb]boolean continueloop [/color][color=#007700]= [/color][color=#0000bb]true[/color][color=#007700];[/color][color=#0000bb]int temp [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700];while( [/color][color=#0000bb]continueloop [/color][color=#007700]){try{[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print( [/color][color=#dd0000]"enter mark of " [/color][color=#007700]+ [/color][color=#0000bb]str [/color][color=#007700]+ [/color][color=#dd0000]" : "[/color][color=#007700]);[/color][color=#0000bb]temp [/color][color=#007700]= [/color][color=#0000bb]integer[/color][color=#007700].[/color][color=#0000bb]parseint[/color][color=#007700]( [/color][color=#0000bb]input[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700]() );if ( [/color][color=#0000bb]temp [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]temp [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700])throw new [/color][color=#0000bb]illegalargumentexception[/color][color=#007700]();else[/color][color=#0000bb]continueloop [/color][color=#007700]= [/color][color=#0000bb]false[/color][color=#007700];}catch ( [/color][color=#0000bb]inputmismatchexception [/color][color=#007700]| [/color][color=#0000bb]illegalargumentexception e [/color][color=#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]"your value is invalid! please enter again!" [/color][color=#007700]);}}return [/color][color=#0000bb]temp[/color][color=#007700];}public [/color][color=#0000bb]void run[/color][color=#007700](){[/color][color=#0000bb]float average [/color][color=#007700]= ( [/color][color=#0000bb]markofmathematic [/color][color=#007700]+ [/color][color=#0000bb]markofphysic [/color][color=#007700]+ [/color][color=#0000bb]markofchemistry [/color][color=#007700]) / [/color][color=#0000bb]3[/color][color=#007700];if ( [/color][color=#0000bb]average [/color][color=#007700]>= [/color][color=#0000bb]8.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=#0000bb]secondname [/color][color=#007700]+ [/color][color=#dd0000]" " [/color][color=#007700]+ [/color][color=#0000bb]firstname [/color][color=#007700]+ [/color][color=#dd0000]" is one of our best students" [/color][color=#007700]);else if ( [/color][color=#0000bb]average [/color][color=#007700]< [/color][color=#0000bb]8.0 [/color][color=#007700]&& [/color][color=#0000bb]average [/color][color=#007700]>= [/color][color=#0000bb]6.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=#0000bb]secondname [/color][color=#007700]+ [/color][color=#dd0000]" " [/color][color=#007700]+ [/color][color=#0000bb]firstname [/color][color=#007700]+ [/color][color=#dd0000]" isn't so bad!" [/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]secondname [/color][color=#007700]+ [/color][color=#dd0000]" " [/color][color=#007700]+ [/color][color=#0000bb]firstname [/color][color=#007700]+ [/color][color=#dd0000]" hasn't enough learned!" [/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]inputoutputonconsole newtest [/color][color=#007700]= new [/color][color=#0000bb]inputoutputonconsole[/color][color=#007700]();[/color][color=#0000bb]newtest[/color][color=#007700].[/color][color=#0000bb]run[/color][color=#007700]();}}[/color] 

  8. #18
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    mình nộp bài


    Mã:
    int namsinh;
            string hovaten;
            float diemtoan,diemly,diemhoa,diemtrungbinh;
            scanner nhapdulieu = new scanner(system.in);
         
            system.out.print("nhập họ và tên sinh viên: ");
            hovaten = nhapdulieu.nextline();
     
            system.out.print("nhập năm sinh: ");
            namsinh= nhapdulieu.nextint();
           
            system.out.print("nhập điểm toán: ");
            diemtoan = nhapdulieu.nextfloat();
           
            system.out.print("nhập điểm lý: ");
            diemly = nhapdulieu.nextfloat();
           
            system.out.print("nhập điểm hóa: ");
            diemhoa = nhapdulieu.nextfloat();
           
            diemtrungbinh = (diemtoan + diemly + diemhoa)/3;
           
            system.out.println("
    sinh viên " + hovaten);
            system.out.println("năm sinh: " + namsinh);
         
            if(diemtrungbinh < 6)
                system.out.println("xếp loại học lực: trung bình");
            else if(diemtrungbinh >= 6 && diemtrungbinh < 8)
                system.out.println("xếp loại học lực: khá");
            else if(diemtrungbinh >= 8)
                system.out.println("xếp loại học lực: giỏi ");
        }
     
            }

  9. #19
    Ngày tham gia
    Apr 2015
    Bài viết
    0
    mình nộp bài nek
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]int namsinh[/color][color=#007700]; [/color][color=#0000bb]string hovaten[/color][color=#007700]; [/color][color=#0000bb]float diemtoan[/color][color=#007700],[/color][color=#0000bb]diemly[/color][color=#007700],[/color][color=#0000bb]diemhoa[/color][color=#007700]; [/color][color=#0000bb]scanner nhapdulieu [/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].print([/color][color=#dd0000]"nhập họ và tên : "[/color][color=#007700]); [/color][color=#0000bb]hovaten [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập năm sinh : "[/color][color=#007700]); [/color][color=#0000bb]namsinh [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); [/color][color=#0000bb]float dtb[/color][color=#007700]; if([/color][color=#0000bb]namsinh [/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]"nhap nam sinh khong hop le"[/color][color=#007700]); } else { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm toán : "[/color][color=#007700]); [/color][color=#0000bb]diemtoan [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm lý : "[/color][color=#007700]); [/color][color=#0000bb]diemly [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập điểm hóa : "[/color][color=#007700]); [/color][color=#0000bb]diemhoa [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if([/color][color=#0000bb]diemtoan [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemly [/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemhoa [/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]diemtoan [/color][color=#007700]>[/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]diemly [/color][color=#007700]>[/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]diemhoa [/color][color=#007700]>[/color][color=#0000bb]10[/color][color=#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]"diem nhap khong hop le!!"[/color][color=#007700]); } else{ [/color][color=#0000bb]dtb [/color][color=#007700]= ([/color][color=#0000bb]diemtoan [/color][color=#007700]+ [/color][color=#0000bb]diemly [/color][color=#007700]+ [/color][color=#0000bb]diemhoa[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; if([/color][color=#0000bb]dtb [/color][color=#007700]<= [/color][color=#0000bb]10.0 [/color][color=#007700]&& [/color][color=#0000bb]dtb [/color][color=#007700]>= [/color][color=#0000bb]8.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]"hoc sinh ten "[/color][color=#007700]+[/color][color=#0000bb]hovaten [/color][color=#007700]+ [/color][color=#dd0000]" dat loai gioi"[/color][color=#007700]); } else if([/color][color=#0000bb]dtb[/color][color=#007700]<[/color][color=#0000bb]8.0 [/color][color=#007700]&& [/color][color=#0000bb]dtb [/color][color=#007700]>= [/color][color=#0000bb]6.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]"hoc sinh ten "[/color][color=#007700]+[/color][color=#0000bb]hovaten [/color][color=#007700]+ [/color][color=#dd0000]" dat loai kha"[/color][color=#007700]); } else if([/color][color=#0000bb]dtb [/color][color=#007700]<[/color][color=#0000bb]6.5 [/color][color=#007700]&& [/color][color=#0000bb]dtb [/color][color=#007700]>= [/color][color=#0000bb]5.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]"hoc sinh ten "[/color][color=#007700]+[/color][color=#0000bb]hovaten [/color][color=#007700]+ [/color][color=#dd0000]" dat loai trung binh"[/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]"hoc sinh ten "[/color][color=#007700]+[/color][color=#0000bb]hovaten [/color][color=#007700]+ [/color][color=#dd0000]" dat loai kem"[/color][color=#007700]); } } }[/color] 
    </blockquote></div>
    </div>
    </div>

  10. #20
    Ngày tham gia
    Jul 2015
    Bài viết
    1
    thanks

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