There is an objective test result such as "OOXXOXXOOO". An 'O' means a correct answer of a problem and an 'X' means a wrong answer. The score of each problem of this test is calculated by itself and its just previous consecutive 'O's only when…
#include<cstdio>#include<cstdlib>#include<cstring>int main(){ char s[80];//输入OOXXOXXOOO,最终得分计算为1+2+0+0+1+0+0+1+2+3=10 int m = 0, sum = 0, i = 0; scanf("%s", s); for (i = 0; i < strlen(s); i++) { if (s[i] == 'X') m = 0; if (s…