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