- 969 名前:デフォルトの名無しさん mailto:sage [2008/06/06(金) 00:39:55 ]
- >>966
がんばってかいたよ!!!うごかしてみてね!!! import java.io.*; public class Sample { public static void main(String[] args) throws IOException { String text = String.format("あんこ1%n" + "あんこ2%n" + "%n" + "あんこ3%n" + "あんこ4%n" + "%n" + "%n" + "あんこ5%n" + "あんこ6%n" + "%n" + "あんこ7%n"); PushbackReader r = new PushbackReader(new StringReader(text)); StringBuilder buf = new StringBuilder(); int c; while ((c = r.read()) != -1) { if (c == 12354) { c += 60; } else if (c == 10) { int cnt = 0; int next; while ((next = r.read()) != -1 && next == 10) { ++cnt; } if (cnt < 2) c += 12279; r.unread(next); } buf.append(Character.toChars(c)); } String result = buf.toString(); System.out.println(result); } }
|

|