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

📄 suinteger.cpp

📁 This a code about the practice of super integar.
💻 CPP
字号:
// SuInteger.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream.h"

#include "SuIntegerClass.h"


int main(int argc, char* argv[])
{
	int count,i;
	char str1[]="21";
	char str2[]="4";


	SuInteger SuIntegerA,SuIntegerB,SuIntegerC;

	cout<<"Super ineger."<<endl<<endl;

	for (i=0; i<sizeof(str1)-1; i++) SuIntegerA.insert_head(str1[i]-'0');
	cout<<"Super Ineger A:";
	SuIntegerA.print();
	
	for (i=0; i<sizeof(str2)-1; i++) SuIntegerB.insert_head(str2[i]-'0');
	cout<<"Super Ineger B:";
	SuIntegerB.print();


	SuIntegerC=SuIntegerA.add(SuIntegerB,count);
	cout<<endl<<"C=A+B:";
	SuIntegerC.print();
	cout<<"Cost:"<<count<<endl<<endl;


	SuIntegerC=SuIntegerA.sub(SuIntegerB,count);
	cout<<"C=A-B:";
	SuIntegerC.print();
	cout<<"Cost:"<<count<<endl<<endl;


	SuIntegerC=SuIntegerA.mul(SuIntegerB,count);
	cout<<"C=A*B:";
	SuIntegerC.print();
	cout<<"Cost:"<<count<<endl<<endl;


	SuIntegerC=SuIntegerA.exp(SuIntegerB,count);
	cout<<"C=A^B:";
	SuIntegerC.print();
	cout<<"Cost:"<<count<<endl<<endl;

	return 0;
}

⌨️ 快捷键说明

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