牛客练习赛142 A
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
long long ans = 0;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
int len = s.size();
long long pw = 1;
for (int j = len - 1; j >= 0; j--) {
if (s[j] == '0') {
ans += 8 * pw;
}
pw *= 10;
}
}
cout << ans << endl;
return 0;
}#牛客创作赏金赛#
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
long long ans = 0;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
int len = s.size();
long long pw = 1;
for (int j = len - 1; j >= 0; j--) {
if (s[j] == '0') {
ans += 8 * pw;
}
pw *= 10;
}
}
cout << ans << endl;
return 0;
}#牛客创作赏金赛#
全部评论
相关推荐
08-14 18:26
门头沟学院 测试工程师 
点赞 评论 收藏
分享
07-27 16:41
乐山师范学院 Java 程序员小白条:学历和简历问题,你想走开发,现在很难的啦,尤其后端方向很难走,前端、测开,都会好很多
,另外要等8月底和9月初去投日常
点赞 评论 收藏
分享
点赞 评论 收藏
分享