VioletaBabel
10821번: 정수의 개수 본문
#include<iostream>
#include<string>
using namespace std;
int main()
{
string text;
int n = 1;
cin >> text;
for (int i = 0; i < text.size(); ++i)
if (text[i] == ',')
++n;
cout << n;
}
'백준 > 백준-C++' 카테고리의 다른 글
| 10808번: 알파벳 개수 (0) | 2017.06.06 |
|---|---|
| 10807번: 개수 세기 (0) | 2017.06.06 |
| 10820번: 문자열 분석 (0) | 2017.06.06 |
| 12813번: 이진수 연산 (0) | 2017.06.06 |
| 1927번: 최소 힙 (0) | 2017.06.05 |
Comments