WA70分,代码如下
#include <bits/stdc++.h>
using namespace std;
int n;
string s="";
long long sum,a;
int main(){
cin >> n >> s;
for(int i = 0;i < s.size();i ++){
if(isdigit(s[i]) != 0){
int x = s[i]-'0';
a = a*10+x;
} else{
if(a != 0)
sum += (a+5);
a=0;
}
}
if(a!=0)
a+=5;
cout << sum+a;
return 0;
}
错误测试点为:⑦⑨⑩
就是改不出来