fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int b = 3;
  6. for (int a = -6; a < 5; a++) {
  7. cout << a << " " << (a % b + b) % b << endl;
  8. }
  9. return 0;
  10. }
Success #stdin #stdout 0s 4480KB
stdin
Standard input is empty
stdout
-6  0
-5  1
-4  2
-3  0
-2  1
-1  2
0  0
1  1
2  2
3  0
4  1