程序填空题:求余函数
编写一个函数int mymod(int a,int b),用来求a除以b的余数,并写出相应的主函数调用它。请填空完成程序功能。
```
int mymod(int a,int b)
{int s,ys;
s=a/b;
ys=@@[a-s*b](2);
return @@[ys](2);
}
#include
int main(void)
{int x,y,myys;
scanf(@@["%d%d",&x,&y](2));
myys=@@[mymod(x,y)](2);
printf(@@["%d\n",myys](2));
return 0;
}
```
答案:
第1空:a-s*b
第2空:ys
第3空:"%d%d",&x,&y
第4空:mymod(x,y)
第5空:"%d\n",myys
```
int mymod(int a,int b)
{int s,ys;
s=a/b;
ys=@@[a-s*b](2);
return @@[ys](2);
}
#include
int main(void)
{int x,y,myys;
scanf(@@["%d%d",&x,&y](2));
myys=@@[mymod(x,y)](2);
printf(@@["%d\n",myys](2));
return 0;
}
```
答案:
第1空:a-s*b
第2空:ys
第3空:"%d%d",&x,&y
第4空:mymod(x,y)
第5空:"%d\n",myys