?? longadd.cpp
字號:
// LongAdd.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "afx.h"
#include "conio.h"
#include "LongCal.h"
/*void pmain(int argc, char* argv[])
{
CLongCal a,b;
a.iniUseString("-1");
b.iniUseString("10");
a.Add(b);
a.toString();
//CString str("22");
//printf("\n%d",str.GetLength());
getch();
}
*/
int main(int argc, char* argv[])
{
if(argc==1)
{
printf("格式:LongAdd 數據文件名!\r\n");
return 0;
}
else if(argc>=3)
{
printf("參數太多!\r\n格式:LongAdd 數據文件名!\r\n");
return 0;
}
else
{
CStdioFile hfile;
if( !hfile.Open( argv[1], CFile::modeRead, NULL))
{
hfile.Close();
printf("數據文件打開出錯!請確認數據文件的存在!\r\n");
return 1;
}
else
{
CLongCal base("0");/////reverse format
CLongCal tobase;
CString str_tobase;
while(hfile.GetPosition()<(hfile.GetLength()-1))
{
hfile.ReadString(str_tobase);
if(str_tobase.IsEmpty())///blank
continue;
tobase.iniUseString(str_tobase);
//if(tobase.isZero()) break;//
base.Add(tobase);
}
base.toString();
}
hfile.Close();
}
getch();
return 2;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -