⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mxiterative.c

📁 该问题是线性移位寄存器的综合问题提出的
💻 C
字号:

	

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <fstream>
using namespace std;

int main(int argc, char *argv[])
{
  typedef vector<bool> MyArray; file://定义自己的数据类
  MyArray a;   file://状态数组 ,用来保存给定的m序列?
  vector<int>l;   file://线性移位寄存器的级数数组
  MyArray temp;
  vector<MyArray> f; file://为线性移位寄存器对应的多项式
  int N =0;
  ifstream infile("input.txt"); file://从文件中读取数据
  ofstream outfile("output.txt"); file://把结果写入文件中。
  if(!infile)
  {
    cout << "Aata file input.txt is not ready! Please check it"<<endl;
    exit (-1);
  }
  string strTemp;
  infile>>strTemp; file://读入N
 // cout << strTemp <<endl;
  N = atoi(strTemp.c_str());
  infile>>strTemp; file://读入序列
  for( int i = 0 ;i<N; ++i)
  {
     a.push_back(strTemp[i]=='1'); file://把序列保存
  }
 file://cout << strTemp <<endl;
 int n=0;
 l.push_back(0);
 temp.push_back(1); file://形成f0
 f.push_back(temp); file://把f0加到f数组中。
 do{
     int dn =0;
     for (int i = 0;i<=l[n];++i)
     {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -