백준/백준-C++

10821번: 정수의 개수

Beabletoet 2017. 6. 6. 00:23

#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;

}

저작자표시 비영리 변경금지 (새창열림)