#include #include #include #include #include Using Namespace std;
INT Main (int Argc, char * argv []) {typef vector myarray; file: // Defines its own data class MyArray A; file: // status array to save a given M sequence? Vector < INT> L; File: // Linear shift register of the array of MYARRAY TEMP; Vector f; file: / / is a polynomial INT n = 0 corresponding to linear shift registers; ifstream Infile ("Input.txt" ); file: // reads data OFSTREAM OUTFILE ("OUTPUT.TXT") from the file; file: // writes the result into the file. IF (! infile) {cout << "AATA file input.txt is not ready! please check it" << Endl; exit (-1);} string straTemp; infile >> strTemp; file: // read N / / cout << strTemp << endl; n = atoi (strTemp.c_str ()); infile >> strTemp; file: // Read sequence for (int i = 0; i
Do {INT DN = 0; for (int i = 0; i <= l [n]; i) {DN = f [n] [i] * a [ni]; file: // calculate DN} DN = DN% 2; File: // Detaure // Cout << "D" << n << "=" << DN << Endl; Int ISUM = 0; for (int i = 0; i <= n; i) {ISUM = L [I]; file: // Decision is that all LNs are equal to 0 is to add all LNs to it is zero} if (DN == 0) File: / / If DN = 0 {f.push_back (f [n]); file: // fn 1 = fn l.push_back (l [n]); file: // ln 1 = ln} else if (! Isum File: // All ln is zero {TEMP.CLEAR (); for (int i = 0; i = 0; --I) {= i; file: // find m breM}} // end for temp.clear (); // empty for the temporary destination array (INT i = 0; i ft; file: // Used to save two polynomial results int LEN = max (Temp.size (), f [n] .size ()); file: // Remove the maximum value of the polynomial coefficient ft.insert (ft.begin (), len, 0); file: // fill the destination array into the LEN zero-initialization for (INT I = 0; i