public static void main(String[] args) { try { // 입력 파일 이름을 입력받는다 Scanner stdin = new Scanner(System.in); System.out.println("Input File Name"); String fileName = stdin.nextLine(); // 파일 읽음 FileRead in = new FileRead(fileName); // 출력 파일 이름을 입력받는다 System.out.println("Output File Name"); fileName = stdin.nextLine(); // 파일 기록 FileWrite out = new FileWrite(fileName); // 암호화 Encrypt encrypt = new Encrypt(); // 복호화 Decrypt decrypt = new Decrypt(); // 암호화된 문자열을 byte 배열에 담는다 byte[] encryptText; // 복호화된 문자열 저장 String decryptText; String plainText = in.fileRead(); System.out.println("Plain Text : " + plainText); // 암호화 encryptText = encrypt.encrypt(plainText); System.out.println("Encrypt Text : " + encryptText); out.fileWrite(encryptText); // 복호화 decryptText = decrypt.decrypt(encryptText); System.out.println("Decrypt Text : " + decryptText); } catch (Exception e) { e.printStackTrace(); System.out.println("Main Exception"); } }
public static void main(String[] args) { List<PokerGameHands> games = FileRead.getGames(); int countPlayer1 = 0, countPlayer2 = 0; for (PokerGameHands g : games) { PokerGameproblem54_ObjContainer c1 = g.firstSet; PokerGameproblem54_ObjContainer c2 = g.secondSet; System.out.println("\n*******************"); System.out.println(c1.list); System.out.println(c2.list); System.out.println(PWIN.getPoint(c1).pwin); System.out.println(PWIN.getPoint(c2).pwin); int n = c1.compareTo(c2); if (n > 0) countPlayer1++; else countPlayer2++; System.out.println(n > 0 ? "Player 1" : "Player 2"); } System.out.println("No of Games : " + games.size()); System.out.println("Player 1 : " + countPlayer1); System.out.println("Player 2 : " + countPlayer2); }
public static void main(String[] args) { FileRead fileread = new FileRead(); String content = fileread.getDataFromFile("Sample.txt"); fileread.getCapital(content); }
void readFromFile(String fname) { FileRead fin = new FileRead(this); fin.Read(); }