?? ma.cpp
字號:
// ma.cpp : 定義控制臺應用程序的入口點。
//
#include "stdafx.h"
#include "algorithm.h"
#include<iostream>
#include<fstream>
using std::cin ;
using std::cout;
int main(int argc,char *argv[])
{
std::ifstream inFile;
std::ofstream outFile;
if (argc !=4)
cout<<"格式 ma sourcefile destfile 最大單詞量";
else
{
inFile.open (argv[1]);
if(inFile==NULL)
{
cout<<"源文件打不開";
}
else
{
outFile.open (argv[2]);
if(outFile==NULL)
cout<<"目標文件打不開";
else
{
int nwords=atoi(argv[3]);
if(nwords<0)
cout<<"單詞量必須大于0";
else
{
algorithm a;
Prefix prefix;
for(int i=0;i<NPREF;i++)
{
a.add(prefix,NONWORD);
}
a.build(prefix,inFile);
a.add(prefix,NONWORD);
a.generate(nwords,outFile);
}
}
}
}
const char *filename="F:\\1.txt";
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -