4 条题解
- 1
信息
- ID
- 110
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 4334
- 已通过
- 1836
- 上传者
#include <bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
cin >> a >> b;
cout << a / b << " " << a % b;
return 0;
}
这道题可以先用除法求出商,再用取余来求出余
#include<bits/stdc++.h>
using namespace std;
int a,b;//新建两个变量,分别代表被除数和除数
int main(){
cin>>a>>b;//输入被除数和除数
cout<<a/b<<' '<<a%b<<endl;//a/b算出商,a%b算出余
return 0;
}