waltermilner

Untitled

Apr 11th, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. public class Test {
  2.  
  3.   public static void main(String[] args) {
  4.     Integer[] a = {8, 7, 6, 4, 3, 2, 1, 0};
  5.     int x=9;
  6.     int n = a.length;
  7.     for (int i = 0; i < n; i++)
  8.       for (int j=0; j<n; j++)
  9.         if (a[i]+a[j]==x)
  10.           System.out.println(a[i]+" "+a[j]);
  11.  
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment