StoneHaos

cycle_2_6

Oct 15th, 2022
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main(void) {
  7.     int a, b, p = 0, q = 0;
  8.     cin >> a >> b;
  9.     while (a >= b) {
  10.         p++;
  11.         a -= b;
  12.     }
  13.     q = a;
  14.     cout << "p = " << p << ", q = " << q << endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment