游客 Signup | Login
中文 | En

2453 - 整除与求余

从键盘读入两个整数,分别求出两个整数的整数商和余数。

Input

输入为一行,两个数之间用空格隔开。

Output

在一行中分别输出商和余数,中间用空格隔开。行末输出一个换行符。

Examples

Input

9 2

Output

4 1

Solution C

#include<stdio.h>

int main()
{
	int a,b,c,d;
	scanf("%d%d",&a,&b);
	c=a/b;
	d=a%b;
	printf("%d ",c);
	printf("%d\n",d);
	return 0;
}

Solution C++

#include<stdio.h>

int main()
{
	int a,b,c,d;
	scanf("%d%d",&a,&b);
	c=a/b;
	d=a%b;
	printf("%d %d",c,d);
	return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题