主页
C++
C++ 算术运算符
demo_oper_division
运行 ❯
×
更改方向
保存代码
更改主题
#include
using namespace std; int main() { int x = 10; int y = 3; cout << (x / y) << "\n"; // Integer division, result is 3 double a = 10.0; double b = 3.0; cout << (a / b) << "\n"; // Decimal division, result is 3.333... return 0; }
3
3.33333