早教吧作业答案频道 -->其他-->
编写函数intmymod(inta,intb)用以求a被b除之后的余数.怎么出错#includeintmymod(int,int)main(){intx,y,z;scanf("%d%d",&x,&y);z=intmymod(x,y);printf("%d",z);}intmymod(inta,intb){intc;c=a%b;returnc;}Compiling...sd.cf:\microsoft
题目详情
编写函数int mymod(int a,int b)用以求a被b除之后的余数.怎么出错
#include
int mymod(int,int)
main()
{
int x,y,z;
scanf("%d%d",&x,&y);
z=int mymod(x,y);
printf("%d",z);}
int mymod(int a,int b)
{
int c;
c=a%b;
return c;}
Compiling...
sd.c
f:\microsoft visual studio\test\sd.c(3) :error C2061:syntax error :identifier 'main'
f:\microsoft visual studio\test\sd.c(3) :error C2059:syntax error :';'
f:\microsoft visual studio\test\sd.c(3) :error C2059:syntax error :')'
执行 cl.exe 时出错.
怎么回事,
#include
int mymod(int,int)
main()
{
int x,y,z;
scanf("%d%d",&x,&y);
z=int mymod(x,y);
printf("%d",z);}
int mymod(int a,int b)
{
int c;
c=a%b;
return c;}
Compiling...
sd.c
f:\microsoft visual studio\test\sd.c(3) :error C2061:syntax error :identifier 'main'
f:\microsoft visual studio\test\sd.c(3) :error C2059:syntax error :';'
f:\microsoft visual studio\test\sd.c(3) :error C2059:syntax error :')'
执行 cl.exe 时出错.
怎么回事,
▼优质解答
答案和解析
#include int mymod(int,int);//要加双引号,这里只是声明函数void main()//最好用void{ int x,y,z; scanf("%d%d",&x,&y); z=mymod(x,y);//调用函数,用函数名即可 printf("%d",z);}int mymod(int a,int b){ int c; c=...
看了 编写函数intmymod(i...的网友还看了以下:
编写函数intmymod(inta,intb)用以求a被b除之后的余数.怎么出错#includei 2020-07-23 …
x=5,y=8Z=7结果为什么是21?逗号表达式还是有点蒙#includeusingnamespa 2020-07-23 …