题目内容:
请补充函数proc(),该函数的功能是判断一个数的十位数字和百位数字之和是否等于其个位上的数字,是则返回“yes!”,否则返回“no!”注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
char*proc(int n)
{
int g,S,b;
g=n%10;
s=n/10%10;
b= 【1】 :
if((s+b)==g)
return 【2】 ;
else
return 【3】 ;
}
void main()
{
int num=0:
system("CLS"):
printf("****Input data****\n");
scanf("%d",&num);
printf("\n\n\n"),
printf("****The result****\n");
printf("\n\n\n%s",proc(num));
}
参考答案:【答案仅供学习,请勿对照自行用药等】
答案解析: