Advertisement
mobinga

Project Euler - Java

Oct 2nd, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package euler;
  2.  
  3. public class Pr4 {
  4. public static void main(String [] args){
  5.  
  6.     long start = System.currentTimeMillis();
  7.  
  8.     for(int o = 900; o<999; o++){
  9.         for(int n = 900; n<999; n++){
  10.                 int vin = o*n;
  11.                  String m = Integer.toString(vin);
  12.                  String s2 = new StringBuffer(m).reverse().toString();
  13.  
  14.                if( m.equals(s2)){
  15.                 System.out.println(s2);}
  16.     }
  17.     }
  18.   double stop = (double)((System.currentTimeMillis() - start)/1000);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement