dev c++ 程序运行就提示停止工作 5
源代码:#include<stdio.h>intjudge(char,char,char);main(){chara,b,c;printf("Pleaseinputthr...
源代码:#include <stdio.h>
int judge(char,char,char);
main()
{
char a,b,c;
printf("Please input three char:");
scanf("%c %c %c",&a,&b,&c);
if ((a>=65)&&(a<=90)&&(b>=65)&&(b<=90)&&(c>=65)&&(c<=90)&&(a>=97)&&(a<=122)&&(b>=97)&&(b<=122)&&(c>=97)&&(c<=122))
{if (judge(a,b,c))
{printf("The letters are adjacent with each other");}
else
{printf("The letters are not adjacent with each other");}
}
else
{printf("The letters are not adjacent with each other");}
}
int judge(char x,char y,char z)
{
if(((y-x)==1)&&((y-z)==1))
return 1;
else
return 0;
}
可以看到“Please input 。。。”的输出,输完之后就停止工作了。。 展开
int judge(char,char,char);
main()
{
char a,b,c;
printf("Please input three char:");
scanf("%c %c %c",&a,&b,&c);
if ((a>=65)&&(a<=90)&&(b>=65)&&(b<=90)&&(c>=65)&&(c<=90)&&(a>=97)&&(a<=122)&&(b>=97)&&(b<=122)&&(c>=97)&&(c<=122))
{if (judge(a,b,c))
{printf("The letters are adjacent with each other");}
else
{printf("The letters are not adjacent with each other");}
}
else
{printf("The letters are not adjacent with each other");}
}
int judge(char x,char y,char z)
{
if(((y-x)==1)&&((y-z)==1))
return 1;
else
return 0;
}
可以看到“Please input 。。。”的输出,输完之后就停止工作了。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询