|
|
back to boardCommon BoardJava code, Test is #3: 1087 Hello! Please tell me where my mistake. _________________________________________ import java.util.Scanner; public class gf { public static void main (String[] args) { Scanner sc = new Scanner(System.in);
int i, s = 0, count = 0;
int n = sc.nextInt();
int m = sc.nextInt();
int Ak[] = new int[m];
for(i = 0; i < m; ++i) { Ak[i] = sc.nextInt(); s+=Ak[i]; count++; }
if(n==s) { if(count % 2 == 0) System.out.println("1"); else System.out.println("2"); } else System.out.println("2");
} Edited by author 25.08.2011 22:41 Edited by author 25.08.2011 22:41 Edited by author 25.08.2011 22:41 Edited by author 25.08.2011 22:42 |
|
|