๋ฐ์ํ
https://level.goorm.io/exam/123589/10%ED%9A%8C-e-pper-ox-%ED%80%B4%EC%A6%88/quiz/1
#include <iostream>
#include <vector>
using namespace std;
int main() {
char input[100];
cin >> input;
int ans = 0;
int tmp = 1;
for(int i = 0; ; i++){
if(input[i] == 'O'){
ans += tmp;
tmp++;
}
else if(input[i] == 'X') {
tmp = 1;
}
else {
break;
}
}
cout << ans;
return 0;
}
๋ฐ์ํ
'๐ฆ Chango > ๐ฃ EDOC' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[์๊ฐ][BOJ][C++] ๋ฐฑ์ค 20044๋ฒ: Project Teams (0) | 2021.09.29 |
---|---|
[๊ตฌ๋ฆ][C++] 14ํ E-PPER 7๋ฒ : ์ ๋ฌธ๊ธฐ์ฌ (0) | 2021.09.27 |
[BOJ G5][C++] ๋ฐฑ์ค 14891๋ฒ: ํฑ๋๋ฐํด (0) | 2021.09.08 |
[BOJ][C++] ๋ฐฑ์ค 1074๋ฒ: Z (0) | 2021.09.07 |
[BOJ][C++] ๋ฐฑ์ค 13305๋ฒ: ์ฃผ์ ์ (0) | 2021.09.06 |