UVA1585 (Score)

UVA1585 (Score)_第1张图片
UVA1585 Score
//此版本只支持一组数据输入
#include 
#define maxn 85
int main()
{
    int scores = 0;
    char c;
    int serial = 0;
    while (scanf_s("%c",&c))
    {
        if (c == 'O')
        {
            serial++;
            scores += serial;
        }
        else
            serial=0;
        continue;
    }
    printf("得分为:%d", scores);
    system("pause");
    return 0;
}
UVA1585 (Score)_第2张图片
运行结果

你可能感兴趣的:(UVA1585 (Score))