티스토리 뷰
백준 8958번
문제 사이트 :
https://www.acmicpc.net/problem/8958
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define Max 81
int Array[Max];
int main(void) {
int Testcase;
scanf("%d", &Testcase);
for (int t = 0; t < Testcase; t++) {
char ch[Max];
scanf("%s", ch);
int score = 0;
int number = 0;
for (int i = 0;ch[i]!='\0'; i++) {
if (ch[i] == 'O') {
score += number;
number++;
}
else {
score += number;
number = 0;
}
}
score += number;
printf("%d\n", score);
}
return 0;
}
'PS > 백준' 카테고리의 다른 글
| 10809번 알파벳 찾기 (0) | 2019.06.24 |
|---|---|
| 10039번 평균 점수 (0) | 2019.06.24 |
| 5622번 다이얼 (0) | 2019.06.24 |
| 4673번 셀프 넘버 (0) | 2019.06.24 |
| 4344번 평균은 넘겠지 (0) | 2019.06.22 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Firebase
- Human Interface Guidelines
- 알고리즘
- DP
- 오토레이아웃
- 싱글톤
- Swift
- 백준
- 디자인패턴
- UIView
- storage
- Human Interface Guideline
- HumanInterfaceGuidelines
- 부스트코스
- 온라인저지
- HIG
- ios
- apple
- MVC
- 분할정복
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
글 보관함
