tmp.cpp
上传用户:z_mail1980
上传日期:2007-06-01
资源大小:647k
文件大小:0k
源码类别:

SNMP编程

开发平台:

Visual C++

  1. // tmp.cpp : Defines the entry point for the console application.
  2. //
  3. #include "stdafx.h"
  4. #include <iostream.h>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. int main(int argc, char* argv[])
  8. {
  9. int count = 0;
  10. int tag = 0;
  11. char ch;
  12. while(ch = getchar()!='n')
  13. {
  14. if(ch==' ')
  15. {
  16. if(tag==1)
  17. {
  18. count++;
  19.     tag = 0;
  20. }
  21. }
  22.     else
  23. tag = 1;
  24. }
  25. cout<<count;
  26. return 0;
  27. }