Trang 9 của 13 Đầu tiênĐầu tiên ... 7891011 ... CuốiCuối
Kết quả 81 đến 90 của 124
  1. #81
    Ngày tham gia
    Feb 2015
    Bài viết
    0
    Mã:
    mình thấy đa số các bạn thiếu phần kiểm tra điểm khống chế.[/size]
    vd: toán:6  lý:9  hóa: 10 như vậy dtb =8.3 đáng lẽ đạt giỏi nhưng bị khống chế môn toán vì chỉ có 6 điểm không đạt điều kiện/
    3 môn phải đạt từ 6.5 trở lên thì mới tính loại giỏi.[size=15px]

  2. #82
    Ngày tham gia
    Jan 2015
    Bài viết
    0
    ad chấm hộ e bài này vs ạ. đề bài là in các số nguyên tố từ 1 cho đến n, với n được nhập từ bàn phím


    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]baitap [/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 i[/color][color=#007700],[/color][color=#0000bb]dem[/color][color=#007700],[/color][color=#0000bb]n[/color][color=#007700],[/color][color=#0000bb]k[/color][color=#007700]; [/color][color=#0000bb]int o[/color][color=#007700]=[/color][color=#0000bb]0[/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]"nhập vào số nguyên n="[/color][color=#007700]); [/color][color=#0000bb]n [/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].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"các số nguyên tố từ 1 đến "[/color][color=#007700]+[/color][color=#0000bb]n[/color][color=#007700]+[/color][color=#dd0000]" là"[/color][color=#007700]); for ([/color][color=#0000bb]i[/color][color=#007700]=[/color][color=#0000bb]1[/color][color=#007700];[/color][color=#0000bb]i[/color][color=#007700]<=[/color][color=#0000bb]n[/color][color=#007700];[/color][color=#0000bb]i[/color][color=#007700]++) { [/color][color=#0000bb]dem [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700]; for ([/color][color=#0000bb]k[/color][color=#007700]=[/color][color=#0000bb]1[/color][color=#007700];[/color][color=#0000bb]k[/color][color=#007700]<=[/color][color=#0000bb]i[/color][color=#007700];[/color][color=#0000bb]k[/color][color=#007700]++) { if ([/color][color=#0000bb]i[/color][color=#007700]%[/color][color=#0000bb]k [/color][color=#007700]== [/color][color=#0000bb]0[/color][color=#007700]) { [/color][color=#0000bb]dem [/color][color=#007700]= [/color][color=#0000bb]dem [/color][color=#007700]+ [/color][color=#0000bb]1[/color][color=#007700]; } } if ([/color][color=#0000bb]dem [/color][color=#007700]== [/color][color=#0000bb]2[/color][color=#007700]) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#0000bb]i[/color][color=#007700]+[/color][color=#dd0000]" "[/color][color=#007700]); [/color][color=#0000bb]o [/color][color=#007700]= [/color][color=#0000bb]o[/color][color=#007700]+[/color][color=#0000bb]1[/color][color=#007700]; if ([/color][color=#0000bb]o[/color][color=#007700]%[/color][color=#0000bb]20[/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=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700](); }}[/color] 

  3. #83
    Ngày tham gia
    Apr 2014
    Bài viết
    0
    import java.util.scanner;
    public class bai7 {

    Mã:
    php
    <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>
    public static void main (string[] args){
    int tuoi, namsinh;
    float diemtoan, diemly, diemhoa, diemtb;
    string ten;
    scanner nhapdulieu = new scanner(system.in);
    system.out.print("nhap ho va ten:");
    ten = nhapdulieu.nextline();
    system.out.print("nhap tuoi:");
    tuoi = nhapdulieu.nextint();
    system.out.print("nhap nam sinh:");
    namsinh = nhapdulieu.nextint();
    system.out.print("nhap diem toan:");
    diemtoan = nhapdulieu.nextfloat();
    system.out.print("nhap diem ly:");
    diemly = nhapdulieu.nextfloat();
    system.out.print("nhap diem hoa:");
    diemhoa = nhapdulieu.nextfloat();

    diemtb = (diemtoan + diemhoa + diemly)/3;
    system.out.println("ho va ten vua nhap:" +ten);
    system.out.println("tuoi vua nhap:" + tuoi+ "va nam sinh" + namsinh);
    if ( diemtb <=5.5 && diemtb>=0){
    system.out.println("ban la hoc sinh trung binh");}
    else if ( diemtb > 5.5 && diemtb < 8){
    system.out.println("ban la hoc sinh kha");}
    else if (diemtb >=8 && diemtb <=10){
    system.out.println(" ban la hoc sinh gioi");}
    else {
    system.out.println("ban da nhap sai diem cua ban!");}
    }
    }

  4. #84
    Ngày tham gia
    Apr 2016
    Bài viết
    0
    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]diemtrungbinh [/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 nhap[/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]"nhap ho ten :"[/color][color=#007700]); [/color][color=#0000bb]string hoten[/color][color=#007700]=[/color][color=#0000bb]nhap[/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]"nhap nam sinh :"[/color][color=#007700]); [/color][color=#0000bb]int namsinh[/color][color=#007700]=[/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextint[/color][color=#007700](); while([/color][color=#0000bb]namsinh[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]namsinh[/color][color=#007700]>[/color][color=#0000bb]2012[/color][color=#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 khong the nho hon 0 or lon hon 2012 "[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap lai nam sinh :"[/color][color=#007700]); [/color][color=#0000bb]namsinh[/color][color=#007700]=[/color][color=#0000bb]nhap[/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]"nhap diem toan :"[/color][color=#007700]); [/color][color=#0000bb]float toan[/color][color=#007700]=[/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); while([/color][color=#0000bb]toan[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]toan[/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 khong the nho hon 0 or lon hon 10"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap lai diem mon toan: "[/color][color=#007700]); [/color][color=#0000bb]toan[/color][color=#007700]=[/color][color=#0000bb]nhap[/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]"nhap diem mon ly: "[/color][color=#007700]); [/color][color=#0000bb]float ly[/color][color=#007700]=[/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); while([/color][color=#0000bb]ly[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]ly[/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 ly khong the nho hon 0 or lon hon 10"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap lai diem mon ly: "[/color][color=#007700]); [/color][color=#0000bb]ly[/color][color=#007700]=[/color][color=#0000bb]nhap[/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]"nhap diem mon hoa: "[/color][color=#007700]); [/color][color=#0000bb]float hoa[/color][color=#007700]=[/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); while([/color][color=#0000bb]hoa[/color][color=#007700]<[/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]hoa[/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 hoa khong the nho hon 0 or lon hon 10"[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap lai diem mon hoa: "[/color][color=#007700]); [/color][color=#0000bb]hoa[/color][color=#007700]=[/color][color=#0000bb]nhap[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#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]"ho ten sinh vien la: "[/color][color=#007700]+[/color][color=#0000bb]hoten[/color][color=#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]namsinh[/color][color=#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 mon toan: "[/color][color=#007700]+[/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#dd0000]" ,mon ly :"[/color][color=#007700]+[/color][color=#0000bb]ly[/color][color=#007700]+[/color][color=#dd0000]" ,mon hoa: "[/color][color=#007700]+[/color][color=#0000bb]hoa[/color][color=#007700]); [/color][color=#0000bb]float dtb[/color][color=#007700]=([/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#0000bb]ly[/color][color=#007700]+[/color][color=#0000bb]hoa[/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]"diem trung binh: "[/color][color=#007700]+[/color][color=#0000bb]dtb[/color][color=#007700]); if([/color][color=#0000bb]dtb[/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]"hoc sinh yeu: "[/color][color=#007700]+[/color][color=#0000bb]dtb[/color][color=#007700]); } else if([/color][color=#0000bb]dtb[/color][color=#007700]>[/color][color=#0000bb]5 [/color][color=#007700]&& [/color][color=#0000bb]dtb[/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]"hoc sinh trung binh: "[/color][color=#007700]+[/color][color=#0000bb]dtb[/color][color=#007700]); } else if([/color][color=#0000bb]dtb[/color][color=#007700]>[/color][color=#0000bb]7 [/color][color=#007700]&& [/color][color=#0000bb]dtb[/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]"hoc sinh kha: "[/color][color=#007700]+[/color][color=#0000bb]dtb[/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 gioi: "[/color][color=#007700]+[/color][color=#0000bb]dtb[/color][color=#007700]); } }}[/color] 
    <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>

  5. #85
    Ngày tham gia
    Jun 2014
    Bài viết
    0
    Trích dẫn Gửi bởi vjrus.ht
    nộp bài nào ^^
    <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]demo1 [/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]string ten[/color][color=#007700]; [/color][color=#0000bb]long nam[/color][color=#007700]; [/color][color=#0000bb]float tb[/color][color=#007700], [/color][color=#0000bb]toan[/color][color=#007700], [/color][color=#0000bb]ly[/color][color=#007700], [/color][color=#0000bb]hoa[/color][color=#007700]; [/color][color=#0000bb]scanner nhapten [/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]ten [/color][color=#007700]= [/color][color=#0000bb]nhapten[/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]nam [/color][color=#007700]= [/color][color=#0000bb]nhapten[/color][color=#007700].[/color][color=#0000bb]nextlong[/color][color=#007700](); if ([/color][color=#0000bb]nam [/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]"nhập sai năm sinh."[/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, lý, hoá: "[/color][color=#007700]); [/color][color=#0000bb]toan [/color][color=#007700]= [/color][color=#0000bb]nhapten[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]ly [/color][color=#007700]= [/color][color=#0000bb]nhapten[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]hoa [/color][color=#007700]= [/color][color=#0000bb]nhapten[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if ((([/color][color=#0000bb]toan [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]toan [/color][color=#007700]> [/color][color=#0000bb]10[/color][color=#007700])) || (([/color][color=#0000bb]ly [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]ly [/color][color=#007700]> [/color][color=#0000bb]10[/color][color=#007700])) || (([/color][color=#0000bb]hoa [/color][color=#007700]< [/color][color=#0000bb]0[/color][color=#007700]) || ([/color][color=#0000bb]hoa [/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]"nhập sai điểm."[/color][color=#007700]); } else { [/color][color=#0000bb]tb [/color][color=#007700]= (float) ([/color][color=#0000bb]toan [/color][color=#007700]+ [/color][color=#0000bb]ly [/color][color=#007700]+ [/color][color=#0000bb]hoa[/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]"điểm trung bình 3 môn: " [/color][color=#007700]+ [/color][color=#0000bb]tb[/color][color=#007700]); if ([/color][color=#0000bb]tb [/color][color=#007700]< [/color][color=#0000bb]3.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]"học lực kém."[/color][color=#007700]); } else { if ([/color][color=#0000bb]tb [/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]"học lực yếu."[/color][color=#007700]); } else { if ([/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]"học lực trung bình."[/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]"học lực khá."[/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]"học lực giỏi."[/color][color=#007700]); } } } } } } }}[/color] 
    </blockquote></div>
    </div>
    </div>
    chấm điểm: 10 điểm
    sau khi nhập tên, sao cứ phải nhấn enter 2 lần thì mới chuyển sang nhập năm sinh nhỉ, lại còn cách dòng nữa.
    giả sử mình nhập sai năm sinh thì nhập lại dc nhưng chương trình không chạy tiếp mà dừng ở chỗ nhập lai năm sinh

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

    show spoiler
    hide spoiler

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


    Mã nguồn PHP:
    [color=#000000]
    import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];[/color][color=#ff8000]/**** @author admin*/[/color][color=#007700]public class [/color][color=#0000bb]bai7_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]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]string ten[/color][color=#007700]; [/color][color=#0000bb]int namsinh[/color][color=#007700]; [/color][color=#0000bb]float toan[/color][color=#007700],[/color][color=#0000bb]ly[/color][color=#007700],[/color][color=#0000bb]hoa[/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]ten [/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]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]toan [/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]ly [/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]hoa [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); if([/color][color=#0000bb]toan [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]ly [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]hoa [/color][color=#007700]< [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]toan [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]ly [/color][color=#007700]> [/color][color=#0000bb]10 [/color][color=#007700]|| [/color][color=#0000bb]hoa [/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 điểm"[/color][color=#007700]); }else { [/color][color=#0000bb]float dtb[/color][color=#007700]; [/color][color=#0000bb]dtb [/color][color=#007700]= ([/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#0000bb]ly[/color][color=#007700]+[/color][color=#0000bb]hoa[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; if([/color][color=#0000bb]dtb [/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]"trung bình"[/color][color=#007700]); }else if([/color][color=#0000bb]dtb [/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]"khá"[/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]"giỏi"[/color][color=#007700]); } } }}[/color] 
    </blockquote></div>
    </div>
    </div>

  7. #87
    Ngày tham gia
    Jul 2015
    Bài viết
    2
    public static void main(string[] args)
    {
    int soluong;
    float tuoi,dt,dl,dh,dtb;
    string hoten[];
    string timten;
    scanner nhaplieu=new scanner(system.in);
    // todo code application logic here
    system.out.println("nhap so luong sinh vien :
    ");
    soluong=nhaplieu.nextint();
    hoten=new string[100];
    for(int i=0;i<soluong;i++)
    {
    system.out.println("nhap ten sinh vien thu i:
    " +i);
    hoten=nhaplieu.next();
    }
    system.out.println("nhap ten sv can tim:
    ");
    timten=nhaplieu.next();

    for(int i=0;i<soluong;i++)
    {
    if(timten.equals(hoten)==true)
    {
    system.out.println("ten muon tim nam o vi tri thu:"+i);
    break;
    }
    }
    system.out.println("nhap tuoi sinh vien:
    ");
    tuoi=nhaplieu.nextfloat();

    system.out.println("nhap diem toan cua sinh vien:
    ");
    dt=nhaplieu.nextfloat();

    system.out.println("nhap diem hoa sv:
    ");
    dh=nhaplieu.nextfloat();

    system.out.println("nhap diem ly sc:
    ");
    dl=nhaplieu.nextfloat();

    dtb=(dt+dl+dh)/3;

    system.out.println("ho ten sv la:");
    system.out.println("
    diem toan sv:"+dt);
    system.out.println("
    diem ly sv:" +dl);
    system.out.println("
    diem hoa sv:"+dh);
    system.out.println(" diem tbsv sv:"+dtb);
    }

  8. #88
    Ngày tham gia
    Mar 2015
    Bài viết
    0
    bai 1<div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>linh (move your mouse to reveal the content)</noscript>

    linh (open)
    linh (close)

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


    Mã nguồn PHP:
    [color=#000000]
    package helloword[/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]helloword [/color][color=#007700]{ [/color][color=#ff8000]/** * @param args the command line arguments */ [/color][color=#007700]public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]double toan[/color][color=#007700],[/color][color=#0000bb]li[/color][color=#007700],[/color][color=#0000bb]hoa[/color][color=#007700], [/color][color=#0000bb]namsinh[/color][color=#007700],[/color][color=#0000bb]trungbinh[/color][color=#007700]; [/color][color=#0000bb]string ten[/color][color=#007700]; [/color][color=#0000bb]scanner a[/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 ten"[/color][color=#007700]); [/color][color=#0000bb]ten[/color][color=#007700]=[/color][color=#0000bb]a[/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]"nhap tuoi"[/color][color=#007700]); [/color][color=#0000bb]namsinh[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#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 diem toan"[/color][color=#007700]); [/color][color=#0000bb]toan[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#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 diem li"[/color][color=#007700]); [/color][color=#0000bb]li[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#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 diem hoa"[/color][color=#007700]); [/color][color=#0000bb]hoa[/color][color=#007700]=[/color][color=#0000bb]a[/color][color=#007700].[/color][color=#0000bb]nextdouble[/color][color=#007700](); [/color][color=#0000bb]trungbinh[/color][color=#007700]=([/color][color=#0000bb]toan[/color][color=#007700]+[/color][color=#0000bb]li[/color][color=#007700]+[/color][color=#0000bb]hoa[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; if ([/color][color=#0000bb]trungbinh[/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]"xep loai gioi"[/color][color=#007700]); else{ if([/color][color=#0000bb]trungbinh[/color][color=#007700]>=[/color][color=#0000bb]6[/color][color=#007700])[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"xep loai kha"[/color][color=#007700]); else {if ([/color][color=#0000bb]trungbinh[/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]"xep 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]"xep loai yeu"[/color][color=#007700]); } }}}[/color] 
    </blockquote></div>
    </div>
    </div>

  9. #89
    Ngày tham gia
    Apr 2015
    Bài viết
    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]
    import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];public class [/color][color=#0000bb]bai7demo [/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]string name[/color][color=#007700]; [/color][color=#0000bb]int birthday[/color][color=#007700]; [/color][color=#0000bb]float math[/color][color=#007700], [/color][color=#0000bb]sp[/color][color=#007700], [/color][color=#0000bb]ch[/color][color=#007700], [/color][color=#0000bb]avag[/color][color=#007700]; [/color][color=#0000bb]scanner ds [/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]"name is: "[/color][color=#007700]); [/color][color=#0000bb]name [/color][color=#007700]= [/color][color=#0000bb]ds[/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]"birthday is: "[/color][color=#007700]); [/color][color=#0000bb]birthday [/color][color=#007700]= [/color][color=#0000bb]ds[/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]"điểm math: "[/color][color=#007700]); [/color][color=#0000bb]math [/color][color=#007700]= [/color][color=#0000bb]ds[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#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 sp: "[/color][color=#007700]); [/color][color=#0000bb]sp [/color][color=#007700]= [/color][color=#0000bb]ds[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#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 ch: "[/color][color=#007700]); [/color][color=#0000bb]ch [/color][color=#007700]= [/color][color=#0000bb]ds[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]avag [/color][color=#007700]= ([/color][color=#0000bb]math [/color][color=#007700]+ [/color][color=#0000bb]sp [/color][color=#007700]+ [/color][color=#0000bb]ch[/color][color=#007700])/[/color][color=#0000bb]3[/color][color=#007700]; if([/color][color=#0000bb]avag [/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]"hoc sinh "[/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]+[/color][color=#dd0000]" đạt thành tích giỏi!"[/color][color=#007700]); } else if ([/color][color=#0000bb]6.5 [/color][color=#007700]<= [/color][color=#0000bb]avag [/color][color=#007700]&& [/color][color=#0000bb]avag [/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]"hoc sinh "[/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]+[/color][color=#dd0000]" đạt thành tích khá!"[/color][color=#007700]); } else if ([/color][color=#0000bb]5 [/color][color=#007700]<= [/color][color=#0000bb]avag [/color][color=#007700]&& [/color][color=#0000bb]avag [/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 "[/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]+[/color][color=#dd0000]" đạt thành tích trung bình!"[/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 "[/color][color=#007700]+[/color][color=#0000bb]name[/color][color=#007700]+[/color][color=#dd0000]" đạt thành tích yếu!"[/color][color=#007700]); } }}[/color] 
    </blockquote></div>
    </div>
    </div>

  10. #90
    Ngày tham gia
    Nov 2014
    Bài viết
    0
    <div class="bbcodeblock bbcodequote bbcmspoilerblock">
    <div class="attribution type"><noscript>b1 (move your mouse to reveal the content)</noscript>

    b1 (open)
    b1 (close)

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


    Mã nguồn PHP:
    [color=#000000]
    package edu[/color][color=#007700].[/color][color=#0000bb]ducky[/color][color=#007700].[/color][color=#0000bb]basic[/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]demo [/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]string hoten[/color][color=#007700];[/color][color=#0000bb]int namsinh[/color][color=#007700];[/color][color=#0000bb]float dtoan[/color][color=#007700], [/color][color=#0000bb]dly[/color][color=#007700], [/color][color=#0000bb]dhoa[/color][color=#007700], [/color][color=#0000bb]dtb[/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]"nhap hoten:"[/color][color=#007700]);[/color][color=#0000bb]hoten [/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]"nhap ngay 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]();if ([/color][color=#0000bb]namsinh [/color][color=#007700]<= [/color][color=#0000bb]0 [/color][color=#007700]|| [/color][color=#0000bb]namsinh [/color][color=#007700]> [/color][color=#0000bb]2014[/color][color=#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 sai ngay sinh"[/color][color=#007700]);[/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhap diem toan:"[/color][color=#007700]);[/color][color=#0000bb]dtoan [/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]"nhap diem ly:"[/color][color=#007700]);[/color][color=#0000bb]dly [/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]"nhap diem hoa:"[/color][color=#007700]);[/color][color=#0000bb]dhoa [/color][color=#007700]= [/color][color=#0000bb]nhapdulieu[/color][color=#007700].[/color][color=#0000bb]nextfloat[/color][color=#007700](); [/color][color=#0000bb]dtb [/color][color=#007700]= (float) ([/color][color=#0000bb]dtoan [/color][color=#007700]+ [/color][color=#0000bb]dly [/color][color=#007700]+ [/color][color=#0000bb]dhoa[/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]"diem trung binh:" [/color][color=#007700]+ [/color][color=#0000bb]dtb[/color][color=#007700]); }}[/color] 
    </blockquote></div>
    </div>
    </div>

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