#include <iostream> using namespace std; int main() { int b = 3; for (int a = -6; a < 5; a++) { cout << a << " " << (a % b + b) % b << endl; } return 0; }
Standard input is empty
-6 0 -5 1 -4 2 -3 0 -2 1 -1 2 0 0 1 1 2 2 3 0 4 1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!