#include <stdio.h>
#include <math.h>
int main()
{
char x,y;
int s;
printf("请输入你要测距的字符:\n");
scanf("%c %c",&x,&y);
s=fabs(x-y)-1;
printf("%d\n",s);
return 0;
}
版权声明:本文为qq_63108921原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
#include <stdio.h>
#include <math.h>
int main()
{
char x,y;
int s;
printf("请输入你要测距的字符:\n");
scanf("%c %c",&x,&y);
s=fabs(x-y)-1;
printf("%d\n",s);
return 0;
}