개발노하우/Java
-
Console & File I/O개발노하우/Java 2007. 4. 30. 12:00
import java.io.*; public class object { public static void main(String arg[])throws IOException{ FileOutputStream fos1 = new FileOutputStream(FileDescriptor.out); File f = new File("aaa.txt"); FileOutputStream fos2 = new FileOutputStream(f); byte by[] = new byte[]{'H','e','l','l','o',' ','J','A','V','A'}; fos1.write(by); fos2.write(by); fos1.close(); fos2.close(); } } ===========================..
-
Java - 달력 미완성.,개발노하우/Java 2007. 4. 20. 11:20
import java.io.*; class cal{ public void input()throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int month; int table[][] = new int[5][7]; char day[] = {'일','월','화','수','목','금','토'}; month = Integer.parseInt(in.readLine()); System.out.println(month+"월달 출력입니다."); for(int z=0;z
-
Java - 계산기 [ 미완성 ]개발노하우/Java 2007. 4. 19. 23:18
import java.io.*; class select { private static int x,y; static int z; int i=0; int tot[] = new int[3]; public static void setx(){ select.x = x; } public static void sety(){ select.y = y; } void ip()throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(int i=0;i
-
Java - 2차원배열 각각의 값 입력받아 출력하기개발노하우/Java 2007. 4. 18. 19:13
import java.io.*; public class Array { public static void main(String arg[])throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.println("첫번째 배열의 수를 입력하세요"); int rd = Integer.parseInt(in.readLine()); System.out.println("두번째 배열의 수를 입력하세요"); int rd1 = Integer.parseInt(in.readLine()); int x[][] = new int[rd][rd1]; for(int i=0;i
-
Java - 간단한 숫자 입력받기개발노하우/Java 2007. 4. 18. 13:00
import java.io.*; public class int_in{ public static void main(String[] arg)throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int kor=0, eng=0,math=0; do { System.out.println("국어 성적을 입력하세요."); kor = Integer.parseInt(in.readLine()); } while(kor=100); do { System.out.println("영어 성적을 입력하세요."); eng = Integer.parseInt(in.readLine()); } while(eng=100); do {..