Guest

CSI-2

By: a guest on Jan 28th, 2012  |  syntax: Java  |  size: 0.70 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStream;
  4. import java.io.InputStreamReader;
  5.  
  6.  
  7. public class CSI2 {
  8.  
  9.        
  10.         public static void main(String[] args) throws IOException {
  11.                 BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
  12.                 String tmp = read.readLine();
  13.                 for(int i=0; i<tmp.length()-4; i++){
  14.                         for(int j=i+1; j<tmp.length()-3; j++){
  15.                                 for(int k=j+1; k<tmp.length()-2; k++){
  16.                                         for(int l=k+1; l<tmp.length()-1; l++){
  17.                                                 for(int m=k+1; m<tmp.length(); m++){
  18.                                                         System.out.println(tmp.charAt(i)+""+tmp.charAt(j)+""+tmp.charAt(k)+""
  19.                                                                                                 +tmp.charAt(l)+""+tmp.charAt(m));
  20.                                                 }
  21.                                         }
  22.                                 }
  23.                         }
  24.                 }
  25.  
  26.         }
  27.  
  28. }