/*
import java.io.FileReader;
import java.io.IOException;
public class Main{
public static void main(String[] args) {
FileReader fin = null;
try {
fin = new FileReader("c:/windows/system.ini");
int c;
while((c = fin.read()) != -1) {
System.out.print((char)c);
}
fin.close();
}
catch(IOException e) {
System.out.println("입출력 오류");
}
}
}
*/
/*
import java.io.*;
public class Main{
public static void main(String[] args) {
InputStreamReader in = null;
FileInputStream fin = null;
try {
fin = new FileInputStream("C:\\Users\\user\\Desktop\\앙모찌모찌.txt");
in = new InputStreamReader(fin);
int c;
System.out.println("인코딩 문자 집합은 " + in.getEncoding());
while((c = in.read()) != -1) {
System.out.print((char)c);
}
in.close();
fin.close();
}
catch(IOException e) {
System.out.println("입출력 오류");
}
}
}
*/
/*
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
FileWriter fout = null;
int c;
try {
fout = new FileWriter("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt");
while(true) {
String line = scanner.nextLine();
if(line.length() == 0)
break;
fout.write(line,0,line.length());
fout.write("\r\n",0,2);
System.out.println("문자열 저장됨");
}
fout.close();
} catch(IOException e) {
System.out.println("입오");
}
scanner.close();
}
}
*/
/*
import java.io.*;
public class Main {
public static void main(String[] args) {
byte b[] = {7,51,3,4,-1,24};
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt");
for(int i=0 ; i<b.length ; i++)
fout.write(b[i]);
fout.close();
} catch(IOException e) {
System.out.println("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt예 죠좡햑 쉬 엵셨솝녜대.귈료뮹율 힉연햆 줅쉐욜");
return;
}
System.out.println("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt읇 죠좡햑옑쒧놰됑.");
}
}
*/
/*
import java.io.*;
public class Main {
public static void main(String[] args) {
byte b[] = new byte [6];
try {
FileInputStream fin = new FileInputStream("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt");
int n=0, c;
while((c = fin.read())!= -1) {
b[n] = (byte)c;
n++;
}
System.out.println("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt에서 읽은 배열을 출력합니다");
for(int i=0 ; i<b.length ; i++)
System.out.print(b[i] + " ");
System.out.println();
fin.close();
}
catch(IOException e) {
System.out.println("C:\\Users\\user\\Desktop\\angMoZZiMoZZi.txt예 죠좡햑 쉬 엵셨솝녜대.귈료뮹율 힉연햆 줅쉐욜");
}
}
}
절대 : 그냥 맨 처음부터 절대적으로 어디 있는지?
상대 : 나를 기준으로 상대적인 경로
*/
import java.io.*;
import java.util.Scanner;
import java.util.Vector;
public class Main {
public static void main(String[] args) {
InputStreamReader in = null;
FileInputStream fin = null;
Vector<String> wordVector = new Vector<String>();
try {
fin = new FileInputStream("C:\\Users\\user\\Desktop\\words.txt");
in = new InputStreamReader(fin);
int c;
Scanner s = new Scanner(new FileReader("C:\\Users\\user\\Desktop\\words.txt"));
while(s.hasNext()) {
String word = s.nextLine();
wordVector.add(word);
}
int x = (int)(Math.random()*25143);
String rd_str = wordVector.get(x);
System.out.println(rd_str);
for(int i=0; i<=rd_str.length() ; i++) {
rd_str
}
//if(wordVector.contains("abc"))
in.close();
fin.close();
}
catch(IOException e) {
}
}
}