Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
391 B
6
Indexable
public class main {
	public static boolean getNo(int[] arr,int x){
		int n1 =arr.length;
		for(int i =0;i<n1-1;i++){
			for(int j =i+1;j<n1;j++){
				if(arr[i]+arr[j]==x){
					return true;
				}
			}
			
		}
		return false;
	}
	public static void main(String[] args){
		int x =7;
		int[] arr={1,3,4,7,8-1};
		boolean t=getNo(arr, x);
		System.out.println(t);
		
		
	}
}