zoukankan      html  css  js  c++  java
  • hdu2072(不同单词数)

    #include<stdio.h>
    #include<string.h>
    char str[100000][50],ch[100000];
    int main()
    {
     int word;
     while(gets(ch))
     {
         if(strcmp(ch,"#")==0)
       break;
      word=0;

      int i,j=0,j1=0,flog=1;

      for(i=0;i<=strlen(ch);i++)
      if(ch[i]!=' '&&ch[i]!='\0')
      str[j][j1++]=ch[i];
      else
      {
          str[j][j1]='\0';
          j++;j1=0;
      }

      for(i=0;i<j;i++)
      {
          if(str[i][0]!='\0')
          {
              word++;
          for(j1=i+1;j1<j;j1++)
                if(strcmp(str[i],str[j1])==0)
                str[j1][0]='\0';
          }
      }

      printf("%d\n",word);
     }
     return 0;
    }

  • 相关阅读:
    Php compiler for .NET framework
    C++ Virtual Inheritance Memory Layout
    MIT公开课汉化
    OpenGL like Vulkan
    C++ Chrono Timer
    VisTools: C++模仿Java体系
    Lua IDE
    PHP调试
    Decoda
    JSRDB
  • 原文地址:https://www.cnblogs.com/xinyuyuanm/p/3053785.html
Copyright © 2011-2022 走看看