알고리즘
[알고리즘] 백준 10821 - 정수의 개수 (C++)
blueberrysoda
2024. 9. 4. 23:08
[문제 링크] : https://www.acmicpc.net/problem/10821
#include <iostream>
using namespace std;
string S;
int Ans;
int main(){
cin >> S;
for(int i=0; i<S.size(); i++){
if(S[i] == ','){
Ans++;
}
}
cout << Ans + 1 << "\n";
return 0;
}