diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index b239f6a..9441642 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -10,6 +10,10 @@ + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml index 219f4e9..41b1e36 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -4,6 +4,8 @@ + + diff --git a/test/src/Test/Test.java b/test/src/Test/Test.java index 61f9d1b..a6c62f4 100644 --- a/test/src/Test/Test.java +++ b/test/src/Test/Test.java @@ -1,25 +1,30 @@ package Test; -import java.util.TreeSet; - -public class Test { - public static void main(String[] args) { - System.out.println(-1 << 1); - TreeSet a = new TreeSet(); - String s = "aback"; - s.toUpperCase(); - a.add(1); - a.add(2); - a.add(5); - a.add(11); - a.add(7); - - System.out.println(a); +import java.io.*; +import java.net.InetAddress; +import java.net.Socket; +public class Test{ + public static void main(String[] args) throws IOException { + Socket socket = new Socket(InetAddress.getLocalHost(), 9090); + OutputStreamWriter outputStream = new OutputStreamWriter(socket + .getOutputStream()); + BufferedReader input = new BufferedReader(new InputStreamReader + (System.in)); + BufferedReader informBack = new BufferedReader(new InputStreamReader + (socket.getInputStream())); + String line; + while ((line=input.readLine())!=null){ + outputStream.write(line+"\n"); + outputStream.flush(); + if (line.equals("exit")){ + break; + } + System.out.println(informBack.readLine()); + } + socket.close(); } - public static T get(T o) { - return o; - } -} \ No newline at end of file +} + diff --git a/test/src/Test/Testreceive.java b/test/src/Test/Testreceive.java new file mode 100644 index 0000000..eb5caf6 --- /dev/null +++ b/test/src/Test/Testreceive.java @@ -0,0 +1,35 @@ +package Test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.ServerSocket; +import java.net.Socket; + +/** + * Created by XiaochengWen on 2016年12月23日. + */ +public class Testreceive { + public static void main(String[] args) throws IOException { + ServerSocket serverSocket = new ServerSocket(9090); + Socket socket = serverSocket.accept(); + BufferedReader inputStream = new BufferedReader(new InputStreamReader + (socket.getInputStream())); + OutputStreamWriter outputStream = new OutputStreamWriter(socket + .getOutputStream()); + BufferedReader input = new BufferedReader(new InputStreamReader + (System.in)); + String s; + while ((s = inputStream.readLine())!=null){ + System.out.println(s); + outputStream.write(input.readLine()+"\n"); + outputStream.flush(); + if (s.equals("exit")){ + break; + } + } + serverSocket.close(); + } + +} diff --git "a/345円212円240円345円257円206円/src/345円212円240円345円257円206円/345円212円240円345円257円206円.java" "b/345円212円240円345円257円206円/src/345円212円240円345円257円206円/345円212円240円345円257円206円.java" index fc6d7a7..f13ba12 100644 --- "a/345円212円240円345円257円206円/src/345円212円240円345円257円206円/345円212円240円345円257円206円.java" +++ "b/345円212円240円345円257円206円/src/345円212円240円345円257円206円/345円212円240円345円257円206円.java" @@ -1,15 +1,13 @@ package 加密; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; +import java.io.*; /** * Created by XiaochengWen on 4/1/16. */ public class 加密 { - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws IOException { // write your code here int index; File inFile = new File("/Users/XiaochengWen/Documents/programmer/JAVA 2015基础班33期/day04/jiami.png"); AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル