char  a[]="i love ios,i want an iphone5s";
    int test=0;                  //记录有多少空格的变量
    for(int i=0;i<strlen(a);i++){
        if(a[i]==' '){           //判断是否等于空格
            test++;
        }
    }printf("%d\n",test);        //输出

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案