2839 - 求两数的整数商 和 商

通过次数

0

提交次数

0

时间限制 : 1 秒 内存限制 : 128 MB

求两数的整数商 和 商 ,商保留两位小数

题目输入

一行 两个整数

题目输出

一行,一个整数,一个实数(两位小数)

输入/输出样例

输入格式

12 8

输出格式

1 1.50

C++解答

#include<iostream>
#include<cstdlib>
#include<cstdio>
using namespace std;
int main()
{
	float a,b;
	int c;
	float d;
	cin>>a>>b;
	c=a/b;
	cout<<c<<" ";
	d=a/b;
	printf("%.2f",d);
	//system("pause");
	return 0;
}