Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cout << "Ingrese n: ";
- cin >> n;
- cout << "\nMultiplicacion de clases en Z" << n << "\n";
- cout << "\n * | ";
- for (int i=0; i<n; i++)
- {
- cout << i << ' ';
- if (i<9)
- cout << ' ';
- }
- cout << "\n----+-";
- for (int i=0; i<n; i++)
- cout << "---";
- cout << endl;
- for (int i=0; i<n; i++)
- {
- if (i<10)
- cout << ' ';
- cout << ' ' << i << " | ";
- for (int j=0; j<n; j++)
- {
- if ((i*j)%n<10)
- cout << ' ';
- cout << (i*j)%n << ' ';
- }
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement