2838 - 求两数的整数商 和 余数
求两数的整数商 和 余数
Input
一行两个整数
Output
一行两个整数
Examples
Input
18 4
Output
4 2
Hint
DIV Mod
Solution C++
#include<iostream> #include<cstdlib> using namespace std; int main() { int a,b,c; cin>>a>>b; c=a/b; cout<<c<<" "<<a-(b*c); return 0; }
Hint
DIV Mod