|
|
back to boardWhy WA test 1 Posted by Oybek 20 Aug 2007 17:45 import java.io.*; import java.util.*; public class misol { public static void main(String args[]) throws IOException { Scanner sc=new Scanner(System.in); PrintWriter pw=new PrintWriter(System.out); String b="abcdefghijklmnopqrstuvwxyzABCDEFJHIJKLMNOPQRSTUVWXYZ"; String s=""; while (sc.hasNext()) { s=sc.nextLine(); s+=" "; int n=s.length(); String d=""; String w=""; for (int i=0;i<n;i++) { d=s.substring(i,i+1); if (b.indexOf(d)<0) { pw.print(w+d); w=""; } else { w=d+w; } } pw.println(); } pw.close(); sc.close(); } } Please, help me Edited by author 20.08.2007 17:46 Edited by author 20.08.2007 17:47 |
|
|