- // tmp.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream.h>
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char* argv[])
- {
- int count = 0;
- int tag = 0;
- char ch;
- while(ch = getchar()!='n')
- {
- if(ch==' ')
- {
- if(tag==1)
- {
- count++;
- tag = 0;
- }
- }
- else
- tag = 1;
- }
- cout<<count;
- return 0;
- }