📄 检验压缩软件错误的程序.txt
字号:
#include "iostream.h"
#include "math.h"
#include "stdlib.h"
#include "conio.h"
#include <fstream.h>
// ????????Dlg.cpp : implementation file
//
#include <string.h>
#include <stdio.h>
# include <cstdlib>
# include <cmath>
# include <iomanip>
/////////////////////////////////////////////////////////////
main()
{
int row1=12000;
int col1=2000;
int size1;
short int *memblock1;//1
memblock1=new short int[row1*col1+92];
if(!memblock1)
{
cout<<"?§°? \n";
}
int row2=12000;
int col2=2000;
int size2;
short int *memblock2;//1
memblock2=new short int[row2*col2+92];
if(!memblock2)
{
cout<<"?§°? \n";
}
ifstream inFile1("hengdian20070626051352_0409494_000.rfe",ios::in|ios::binary);
if (inFile1.is_open())
{
size1 = row1*col1*2+92*2;//////////////////////////////////////////
inFile1.read((char*)memblock1, size1);
inFile1.close();
cout << "the complete file content is in memory";
}
else
{
cout<< "MAIN: Error while opening forcedata file " <<endl;
// return 0;
}
ifstream inFile2("filename",ios::in|ios::binary);
if (inFile2.is_open())
{
size2 = row2*col2*2+92*2;//////////////////////////////////////////
inFile2.read((char*)memblock2, size2);
inFile2.close();
cout << "the complete file content is in memory";
}
else
{
cout<< "MAIN: Error while opening forcedata file " <<endl;
// return 0;
}
ofstream outFile("DELTA OF YA AND YU.txt");
if (!outFile)
{
cout<< "MAIN: Error while opening output file " <<endl;
// return 0;
}
for (int i=0; i<row1; i++)
{
// short int h=hh1;
for (int k=0; k<col1; k++)
{
int delta=(short int)memblock1[i*col1+k]-(short int)memblock2[i*col1+k];
if(delta!=0)
{
cout<<delta<<endl;
outFile <<delta;
outFile <<endl;
}
}
// cout<<sum<<endl;
}
outFile.close();
delete []memblock1;
delete []memblock2;
///////////////////////////
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -