https://www.acmicpc.net/problem/1152
using System;
using System.IO;
namespace baekjoon
{
class Program
{
static void Main(string[] args)
{
// 표준 입출력 스트림 reader,writer 만들기
// 영어 대소문자와 공백으로 이루어진 문자열 입력받기
// 문자열에 몇 개의 단어가 있는지 구하기 (단어는 공백 한 개로 구분됨.)
// 버퍼에 저장
// 버퍼 한 번에 비우기
StreamReader sr = new StreamReader(Console.OpenStandardInput());
StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
string strInput = sr.ReadLine();
string[] strArr = strInput.Trim().Split(' ');
sw.WriteLine(strArr.Length);
sw.Flush();
sr.Close();
sw.Close();
}
}
}