자바 의 간단 한 디지털 처리

5531 단어
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

/**
 * 

* Title:ChangeNumber *

*

* Description:10W ,5 3 , 3 。 *

*

* Location:Frostburg *

* *
@author: Eric.Chen * @date:2017 9 19 10:57:26 */ public class ChangeNumber { public static void main(String[] args) throws IOException { // FileReader ChangeNumber re = new ChangeNumber(); FileReader fr = new FileReader("F:\
umber.txt"); String str = ""; for (int i = 0; i < 10000; i++) {// char len1 = (char)fr.read();// str += len1; } fr.close(); String t1 = str; String finalNumber = re.cutNumber(t1);//// System.out.println(finalNumber); // FileWriter fw = new FileWriter("F:\
ew.txt"); char[] charArray = finalNumber.toCharArray();// for (int i = 0; i < charArray.length; i++) { fw.write(charArray[i]);// fw.flush();// } fw.close();// } public String cutNumber(String str)// , 3 { String str1 = str.replaceAll(" ", "");// StringBuffer sb = new StringBuffer(); for (int i = 0; i < str1.length() - 3; i += 3) { String sub = str1.substring(i, i + 3);// sb.append(sub);// sb.append(" ");// } String str3 = sb.toString();// return str3; } }

 
다음으로 전송:https://www.cnblogs.com/AwinChen/p/7572803.html

좋은 웹페이지 즐겨찾기