C++ 代码实现整数除法求商和余数
#include <iostream>
int main() {
int a, b;
std::cout << 'Enter two integers: ';
std::cin >> a >> b;
int quotient = a / b;
int remainder = a % b;
std::cout << 'Quotient: ' << quotient << std::endl;
std::cout << 'Remainder: ' << remainder << std::endl;
return 0;
}
原文地址: https://www.cveoy.top/t/topic/pd5J 著作权归作者所有。请勿转载和采集!