Admin Admin
Tổng số bài gửi : 166 Age : 40 Registration date : 01/06/2007
| Tiêu đề: Chua bai thuc hanh Wed Aug 29, 2007 6:48 am | |
| - Code:
-
<html> <head> <meta> <title>Untitled Document</title> <script> function cong(x, y) { x1 = parseFloat(x); y1 = parseFloat(y); var C; C = x1 + y1; form.ketqua.value=C; //document.write("ket qua la: " + C); } function tru(x, y) { var C; C = x - y; // form.ketqua.value=C; // document.write("ket qua la: " + C); } function nhan(x, y) { var C; C = x * y; //document.write("ket qua la: " + C); form.ketqua.value=C; } function chia(x, y) { var C; C = x / y; //document.write("ket qua la: " + C); form.ketqua.value=C; } function kiemtra(x) { var a, s; var counter=0; for(a=2; a<x/2 ; a++) { if(x % a==0) counter++; } if(counter==0) { document.write("So: " + x + " la nguyen to"); } else { document.write("So: " + x+ " khong phai la nguyen to"); } } </script> </head> <body> <form> <p> Nhap so thu nhat: <input><br> Nhap so thu hai: <input><br> </p> <p> <input> <input> <input> <input> </p> <p> Ket qua: <input> </p> <Hr color="#FF0000"> Nhap so de kiem tra: <input><br> <input>
</form> </body> </html>
| |
|
Admin Admin
Tổng số bài gửi : 166 Age : 40 Registration date : 01/06/2007
| Tiêu đề: Re: Chua bai thuc hanh Mon Sep 03, 2007 5:34 am | |
| Bai sap xep danh sach ten - Code:
-
<html> <head> <title>Untitled Document</title> <script>
var i=0, nhap; names = new Array(); do { nhap = window.prompt("Ban hay nhap ten cua ban:"); if( nhap > " " && nhap != "undefined") names[i]=nhap; i=i+1; } while(nhap>" " && nhap!= "undefined"); names = names.sort(); document.write("<H2>" + (names.length) + "names entered.</H2>"); document.write("<ol> "); for(var i in names){ document.write("<li> " + names[i] + "<br>");} document.write("</ol>");
</script> </head> <body> </body> </html>
| |
|
Admin Admin
Tổng số bài gửi : 166 Age : 40 Registration date : 01/06/2007
| Tiêu đề: Re: Chua bai thuc hanh Mon Sep 03, 2007 7:00 am | |
| Nhap va tinh ket qua: - Code:
-
<DOCTYPE> <html> <head> <meta> <title>Untitled Document</title> <script> function tinhtoan(x) { var y,n; if(x=form.text_1.value) { y=x*2; form.ketqua.value=y; } else if(x=form.ketqua.value) { n=x/2; form.text_1.value=n; } if(form.binhphuong.checked) { y=x*x; form.ketqua.value=y; } } </script> </head> <body> <form> <p> <input> <input> <input> <input> </p> <p> Nhap so: <input> <input> Binh phuong <br><br> Ket qua: <input> </p> </form> </body> </html>
| |
|
Sponsored content
| Tiêu đề: Re: Chua bai thuc hanh | |
| |
|