#include<stdio.h>
#include <stdlib.h>
int tist(char b, int c);
int nums(int a)
{
char y[2] ;
if ( a % 5 == 0)
{
printf("这个数字可以被5整除!");
return 0;
}
else
{
printf("这个数字不可以被5整除!");
printf("是否要继续进行加法?");
system("pause");
scanf("%s",y);
tist(y[2],a);
//a = tist(y,a);
//nums(a);
return 0;
}
}
int tist(char b ,int a)
{
if (b == 'YES' || b == 'yes')
{
a += 1;
printf("这个数字是%d 进行加法计算",a);
return a;
}
else
{
printf("这个数字是%d 未进行加法计算",a);
return 0;
}
}
int main()
{
int x;
printf("请输入一个数字:");
scanf("%d", &x);
printf("你输入的这个数字是:%d ", x);
if (x <= 20)
{
nums(x);
}
else
{
printf("你输入的这个数字大于20,不予以判断");
}
return 0;
}
输入7
再输入yes时候,显示“没有进行加法运算。
不知道怎么回事
”谢谢大家!