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

📄 list5-1.cpp

📁 这是c++编程方面的名著的例子代码
💻 CPP
字号:
// Listing 5-1
// Demonstrates the use of command line
// arguments used with a user defined mt_rational class

#include <iostream.h>
#include "mtration.h"
#include <stdlib.h>

void main(int argc, char *argv[])
{

   if(argc == 5){
     try{
	  mt_rational X(atol(argv[1]),atol(argv[2]));
	  mt_rational Y(atol(argv[3]),atol(argv[4]));
	  cout << X + Y;
     }
     catch(general_exception &X)
     {
       cout << X.message() << endl;
     }
   }

}

⌨️ 快捷键说明

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