code blocks 写的不能运行 错误叫permission denied
程序是用来除掉一串字符前面和后面的空白符的,中间的不动,貌似是加了前面的char str1和最后的if语句之后就没法打开了,之前也遇见过一次,忘了是怎么解决的。。
程序代码:#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main()
{
int i,j,count,temp;
char str[101],str1[4];
str1[0]='E';
str1[1]='N';
str1[2]='D';
str1[3]='\0';
while (gets(str)!=NULL)
{
for (count=0;;)
{
if (str[count]!='\0')
count++;
else
break;
}
for (i=0;; i++) //zheng xiang.
{
temp=isspace(str[i]);
if (temp!=8)
break;
}
for (j=0;;)//qv kongbai fu
{
str[j]=str[i];
i++;
j++;
if (str[j]=='\0')
{
count=j;
break;
}
}
for (i=j-1;; i--)//ni xiang qv kongbai
{
temp=isspace(str[i]);
if (temp!=8)
{
str[i+1]='\0';
break;
}
}
printf("%s\n",str);
if (strcmp(str,str1)==0)
return 0;
}
return 0;
}
求解啊。。。。




明白了