• 大小: 4KB
    文件类型: .cpp
    金币: 1
    下载: 0 次
    发布日期: 2021-01-04
  • 语言: C/C++
  • 标签: c++  分数  加减乘除  

资源简介

分数的加减乘除及化简c++分数的加减乘除及化简c++分数的加减乘除及化简c++

资源截图

代码片段和文件信息

#include 
using namespace std;
class rationalNumber
{
      public:
             void simplify()
             {
                          int i;int j;
                          int r;
                          i=num;
                          j=den;
                          while(j!=0)
                          {
                                     r=j;
                                     j=i%j;
                                     i=r;
                                     }
                          num=num/i;
                          den=den/i;                         
                          }
             rationalNumber(int nuint de)
             {
                                    num=nu;
                                    den=de;
          

评论

共有 条评论