diff --git a/Luogu/problem/CF1573A/CF1573A.cpp b/Luogu/problem/CF1573A/CF1573A.cpp new file mode 100644 index 00000000..9a768c60 --- /dev/null +++ b/Luogu/problem/CF1573A/CF1573A.cpp @@ -0,0 +1,22 @@ +#include + +using namespace std; + +int t, n, ans; +string s; + +int main() { + cin >> t; + while (t--) { + ans = 0; + cin >> n >> s; + for (int i = 0; i < s.size(); i++) { + if (s[i] != '0') { + ans += s[i] - '0'; + ans += i != n - 1; + } + } + cout << ans << endl; + } + return 0; +}