//Find the additive inverse of Zn
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
while(cin>>n){
puts("(0, 0)");
for(int i=0;i<=n/2;i++)
for(int j=n-1;j>=0;j--)
if(i+j==n)
cout<<"("<<i<<", "<<j<<")"<<endl;
}
return 0;
}
Showing posts with label Additive Inverse. Show all posts
Showing posts with label Additive Inverse. Show all posts
Tuesday, July 16, 2013
Find all additive inverse pairs in Zn
Subscribe to:
Comments (Atom)