using namespace std;
int main() {
int t; cin >> t; for (int i = 0; i < t; i++){ string s; int p[6] = {0}; cin >> s; for (auto j = 0; j < s.length(); j++){ p[j % 6] += s[j]; p[j % 6] %= 10; } cout << "case #" << i << ":" << endl << p[0] << p[1] << p[2] << p[3] << p[4] << p[5] << endl; } return 0;
}
直接模拟
using namespace std; int T; string strs; void solve() { int ll=strs.length(); for(int i=0;i<6;i++) { int tmp=0; for(int j=i;j<ll;j+=6) tmp+=strs[j]; cout<<tmp%10; } cout<>T; for(int step=0;step>strs; printf(“case #%d:\n”,step); solve(); } return 0; }
include
using namespace std;
int main()
{
}
直接模拟
include
using namespace std;
int T;
string strs;
void solve()
{
int ll=strs.length();
for(int i=0;i<6;i++)
{
int tmp=0;
for(int j=i;j<ll;j+=6) tmp+=strs[j];
cout<<tmp%10;
}
cout<>T;
for(int step=0;step>strs;
printf(“case #%d:\n”,step);
solve();
}
return 0;
}