A. A+B Again?
time limit per test
1 second
memory limit per test
256 megabytes
Given a two-digit positive integer nn, find the sum of its digits.
Input
The first line contains an integer tt (1≤t≤901≤t≤90) — the number of test cases.
The only line of each test case contains a single two-digit positive integer nn (10≤n≤9910≤n≤99).
Output
For each test case, output a single integer — the sum of the digits of nn.
Example
Input
Copy
8
77
21
40
34
19
84
10
99
Output
Copy
14 3 4 7 10 12 1 18
解题说明:水题,由于只有两位,直接求出a和b然后累加即可。
#include <stdio.h>int main()
{int t;scanf("%d", &t);while (t--) {int n;scanf("%d", &n);printf("%d\n", n % 10 + n / 10);}return 0;
}