asp

<html>
<head>
<title> 자바 스크립트의 폼 객체 </title>
<script language = " javascript">
function disp()  {
 var str = "* form 객체의 속성에 대한 정보 *** " +  "\n"
 
str + = "name: " + document.ken.name + "\n"
str + = "action: " + document.ken.action + "\n"
str + = "method: " + document.ken.method + "\n"
str + = "target: " + document.ken.target + "\n"
str + = "encoding: " + document.ken.encoding + "\n"
str + = "elements: " + document.ken.elements + "\n"
str + = "length: " + document.ken.length + "\n"
str + = "elements[0]: " + document.ken.elements[0].value + "\n"
str + = "elements[1]: " + document.ken.elements[1].value + "\n"

alert(str) }
</script>
</head>


<body>
학과 등록
<form name = "ken" action = "ken.htm" method = post target>
ID  : <input type = "text" name = " dep1" size = 15> <br>
PW  :<input type = "password" name = " dep2" size = 15> <br>
<input type="button" value="품 속성 정보" onclick= disp() > <br>
</form>
</body>
</html>

asp

<html>
<head>
<title> a </title>
</head>
<body>

<%
Dim diff,id
id = 850210
diff = DateDiff("yyyy","02-10-1985",now)

response.write "내 나이는 :(diff)" & diff + 1 & "<br>"

response.write "내 나이는 (left):" & year(date) - Left(id,2) - 1900 + 1& " "

%>

</body>
</html>


 

비교

import java.util.Scanner;
public class ex3 {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO 자동 생성된 메소드 스텁
 
  int nu1, nu2;
  int max, min;
 
  Scanner scan = new Scanner(System.in);
  System.out.println("두 개의 정수 값을 입력하시오. : ");
  nu1 = scan.nextInt();
  nu2 = scan.nextInt();
 
  if (nu1 > nu2)
  {
   max =  nu1;
   min = nu2;
  }
 
  else
  {
   max = nu2;
   min = nu1;
     
  }
 
 
  System.out.println(" 최대값은" + max + "이다");
  System.out.println("최소값은 " +  min + "이다.");
 

 }

}

평균값 구하기

import java.util.Scanner;
public class ex2 {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO 자동 생성된 메소드 스텁
  int com,pro,math,arch;
  float ave;
 
 
 
  Scanner scan = new Scanner (System.in);
  System.out.print(" 영작:");
  com = scan.nextInt();
 
 
 
  System.out.print(" 프로그래밍: ");
  pro = scan.nextInt();
 

  System.out.print("이산수학 : ");
  math = scan.nextInt();
 

  System.out.print(" 컴퓨터구조 과목 : ");
  arch = scan.nextInt();
 
  ave = (float)(com + pro + math + arch)/ 4;
 


  System.out.println("평균 점수  : " + ave );
 
 
 
 
 
 }

}



티스토리 툴바