fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void foo(int x, int y, int& a, int& b)
  5. {
  6. a = x / y;
  7. b = x%y;
  8. }
  9.  
  10. int main()
  11. {
  12. int q = 0, r = 0;
  13. foo(23, 7,q,r);
  14. cout << "몫 : " << q << " 나머지 : " << r << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
몫 : 3  나머지 : 2