VC 代码 修改

来源:百度知道 编辑:UC知道 时间:2024/05/25 20:39:13
# include"stdio.h"
char *fun(int n)
{ int a,b,c;
a=n%10;
b=n/10%10;
c=n%100;
if((a+c)==b)
return "yes";
else
return "no";
void main()
{
int num1=356,num2=495;
printf("\n%s,%s\n",fun(num1),fun(num2));
}

#include"stdio.h"

char *fun(int n)
{
int a,b,c;
a=n%10;
b=n/10%10;
c=n%100;
if((a+c)==b)
return "yes";
else
return "no";
}

void main()
{
int num1=356,num2=495;
printf("\n%s,%s\n",fun(num1),fun(num2));
}

老兄,你代码写的可以,只是fun函数结束的时候少了一个括号,还有一般引用头文件的时候<stdio.h>你自己写的头文件引用的时候才是"" 这样是为了效率考虑的,希望我的回答可以帮到你