游客 Signup | Login
中文 | En

1848 - 课后习题9.2

输入两个整数,求他们相除的余数。用带参的宏来实现,编程序。

Input

a b两个数

Output

a/b的余数

Examples

Input

3 2

Output

1

Solution C

#include<stdio.h>
#define MOD(x,y) x%y
main()
{
  int a,b;
  scanf("%d%d",&a,&b);
  printf("%d\n",MOD(a,b));
}

Solution C++

#include<bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
	cin>>a>>b;
	cout<<a%b;
		
    return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题