ac

.  •  5个月前


include <bits/stdc++.h>

using namespace std;

int main() {

long long s[250] = {0, 1, 2, 3, 4, 1, 2, 3, 4, 5};
long long a;
long long n;
cin >> n;
int ans;
while (n--) {
	ans = 0;
	cin >> a;
	while (a > 0) {
		int b = a % 10;
		ans += s[b];
		a = a / 10;

	}
	cout << ans << endl;
}
return 0;

}


评论:

请先登录,才能进行评论