You are viewing a single comment's thread. Return to all comments →
can any one tell me why this is wrong??
public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int arr[]=new int[n]; int sum=0; for(int i=0; i
} if(sum%2==1) { System.out.println("NO"); } int count=0; for(int i=0; i<n; i++) { if(arr[i]%2!=0) { arr[i]=arr[i]+1; arr[i+1]=arr[i+1]+1; count+=2; } } System.out.println(count);
}*
Seems like cookies are disabled on this browser, please enable them to open this website
Fair Rations
You are viewing a single comment's thread. Return to all comments →
can any one tell me why this is wrong??
here is my code in java
public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int arr[]=new int[n]; int sum=0; for(int i=0; i
}*