import java.math.BigDecimal;
import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
int t=in.nextInt();
while(t-->0){
BigDecimal a,sum=BigDecimal.ZERO;
while(true){
a=in.nextBigDecimal();
if(a.equals(BigDecimal.ZERO)){
System.out.println(((sum.toPlainString()).replaceAll("0+$","")).replaceAll("\\.+$",""));
break;
}
sum=sum.add(a);
}
}
}
}
import java.util.Scanner;
class Main {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
int t=in.nextInt();
while(t-->0){
BigDecimal a,sum=BigDecimal.ZERO;
while(true){
a=in.nextBigDecimal();
if(a.equals(BigDecimal.ZERO)){
System.out.println(((sum.toPlainString()).replaceAll("0+$","")).replaceAll("\\.+$",""));
break;
}
sum=sum.add(a);
}
}
}
}
Comments
Post a Comment