#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double count_digit(long);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  double sum;
  long n, i, t;
  scanf("%ld", &t);
  for (i = 1; i <= t; i++) {
    scanf("%ld", &n);
    sum = count_digit(n);
    printf("%.0lf\n", sum);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jg     11a5 <main+0x75>
lea    0xe94(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <count_digit@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1157 <main+0x27>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebe(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
jle    1198 <main+0x68>
xor    %ebx,%ebx
lea    0xea3(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xe9b(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x10(%rsp),%rdi
call   1030 <count_digit@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    0x8(%rsp),%rbx
jl     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %5)
store i64 1, i64* %4
br label %7
7: ; preds = %17, %0
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = icmp sle i64 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
%13 = load i64, i64* %3
%14 = call double @count_digit(i64 %13)
store double %14, double* %2
%15 = load double, double* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %17
17: ; preds = %11
%18 = load i64, i64* %4
%19 = add nsw i64 %18, 1
store i64 %19, i64* %4
br label %7
20: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [7 x i8] c"%.0lf\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = icmp slt i64 %6, 1
br i1 %7, label %17, label %8
8: ; preds = %0, %8
%9 = phi i64 [ %14, %8 ], [ 1, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%11 = load i64, i64* %1
%12 = call double @count_digit(i64 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = add nuw nsw i64 %9, 1
%15 = load i64, i64* %2
%16 = icmp slt i64 %9, %15
br i1 %16, label %8, label %17
17: ; preds = %8, %0
ret i32 0
}