Find the value of the matrix _ for multiple table substitution password decryption do prepare __ modern cryptography

Source: Internet
Author: User
Tags mul prepare

Introduced:

First enter n, then enter n * n matrix, and finally output the value of the matrix.

#include <bits/stdc++.h> using namespace std;
float result;
int a[1010][1010];
float aa[1010][1010];
int n;
        void Swap (float *a, float *b) {for (int i = 1; I <= n; ++i) {Float temp = a[i];
        A[i] = B[i];
    B[i] = temp;
    } void GetValue () {float mul;
    int iter = 0;
    result = 1.0;
            for (int i = 1; I <= n; ++i) {if (aa[i][i] = 0) {for (int k = i + 1; k <= N; ++k)
                    {if (Aa[k][i]!= 0) {Swap (Aa[i], aa[k]);
                    iter++;
                Break 
                for (int k = i + 1; k <= N; ++k) {if (Aa[k][i]!= 0) {
                Mul =-1 * (Aa[k][i]/aa[i][i]);
                Aa[k][i] = 0;
                for (int p = i + 1; p <= N; ++p) {aa[k][p] + = Mul * Aa[i][p];
    }
            }
        }for (int i = 1; I <= n; ++i) result *= Aa[i][i];
if (iter% 2 = 1) result =-result;
    } void Input () {scanf ("%d", &n);
            for (int i = 1; I <= n; ++i) for (int j = 1; j <= N; ++j) {scanf ("%d", &a[i][j]);
        AA[I][J] = A[i][j]; } void Putout () {for (int i = 1; I <= N. ++i) {for (int j = 1; j <= N; ++j) cout <& Lt
        AA[I][J] << "";
    cout << Endl;
    int main () {Input ();
    GetValue ();
    Putout ();
cout << result << Endl;
 }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.