Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <array>
- using namespace std;
- int main()
- {
- bool b = false;
- int n=0;
- int m=0;
- array<int,20> z25;
- for (int i=0; i<20; i++) //inicializacion z25
- {
- n++;
- if(n % 5 != 0)
- z25.at(i) = n;
- else
- i--;
- }
- array<int,20> simetricos = z25;
- /*for (int i=0; i<20; i++)
- cout << simetricos.at(i) << ' ';
- cout << endl;
- for (int i=0; i<20; i++)
- cout << z25.at(i) << ' ';*/
- cout << "\nMultiplicacion de clases en Z25 - {0,5,10,15,20}\n";
- cout << "\n * | ";
- for (int i=1; i<25; i++)
- {
- if (i%5==0) continue;
- cout << i << ' ';
- if (i<9) cout << ' ';
- }
- cout << "\n----+-";
- for (int i=1; i<21; i++)
- cout << "---";
- cout << endl;
- for (int i=1; i<25; i++)
- {
- if (i%5==0) continue;
- if (i<10) cout << ' ';
- cout << ' ' << i << " | ";
- for (int j=1; j<25; j++)
- {
- if (j%5==0) continue;
- if (i*j%25%5==0) return 1;
- if ((i*j)%25<10) cout << ' ';
- cout << (i*j)%25 << ' ';
- if (i*j%25 == 1)
- {
- simetricos.at(m) = j;
- m++;
- }
- for (int k=0; k<20; k++)
- if (z25.at(k) == i*j%25)
- {
- b = true;
- break;
- }
- if (not b)
- return 1;
- b = false;
- }
- cout << endl;
- }
- cout << endl;
- for (int i=0; i<20; i++)
- {
- cout << "Simetrico de " << z25.at(i) << ": " << simetricos.at(i) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement