
public class Main3 {

	public static int countZeros(int []a,int len){
		if(len==1){
			if(a[0]==0)
				return 1;
			else
				return 0;
		}

		if(a[len-1]==0)
			return 1+countZeros(a, --len);
		else
			return countZeros(a, --len);

	}


	public static int sumOfArray(int []a,int len){
		if(len==1){
			return a[0];
		}

		return a[len-1]+sumOfArray(a, --len);

	}

	public static int pow(int x,int y){
		if(y==0){
			return 1;
		}
		return x*pow(x, --y);
	}

	public static int gcd(int x,int y){

		if(x%y == 0)
			return y;

		return gcd(x, x%y);
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println(countZeros(new int []{0,1,0,0}, 4));
		System.out.println(sumOfArray(new int []{3,1,2,1}, 4));
		System.out.println(pow(2, 3));
		System.out.println(gcd(27, 12));





	}

}
