Https://hack.codingblocks.com/app/contests/4172/3297/problem

import java.util.;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int num=sc.nextInt();
int a=1;
int result=0;
int decimalp=1;
if(num>=1 && num<=12){
while(a<=num){
int digits=sc.nextInt();
if(digits>=0 && digits<=9){
result=result+digits
decimalp;
decimalp=decimalp*10;

            }

            else{
                System.exit(0);
            }
            a++;
        }
        System.out.println(result);
    }
  
}

}
// why my all test cases are not passing for this problem.