求救~~~

来源:互联网 发布:英雄杀cdkey 淘宝 编辑:程序博客网 时间:2024/06/06 03:06

#include<stdio.h>
void main()
{
 int i,n;
 char s[20];
 printf("input a string:");
 i=0;
 while((s[i]=getchar())!='/n')
  i++;
 s[i]='/o';

 for(i=0;s[i]!='/o';i++)
  if(s[i]!='.')
   n++;
  if(n!=0)
   printf("The length is %d /n",n+1);
  else
   printf("Empty/n");
}

 

为什么有问题?

原创粉丝点击