fraction-client.cpp.svn-base

来自「QT方面的开发」· SVN-BASE 代码 · 共 26 行

SVN-BASE
26
字号
#include "fraction.h"#include <iostream>int main() {    const int DASHES = 30;    using namespace std;        {   /* nested scope, inner block */        int i;        for (i = 0; i < DASHES; ++i)            cout << "=";        cout << endl;    }       // cout << "i = " << i << endl;  /* error, i no longer exists, so it is not visible in this scope. */    Fraction f1, f2;    f1.set(3, 4);    f2.set(11,12);  /* set through a member function */    // f2.m_Numerator = 12; /* error, m_Numerator is visible but not accessible. */    cout << "The first fraction is: " << f1.toString() << endl;    cout << "\nThe second fraction, expressed as a double is: "         << f2.toDouble() << endl;    return 0;}

⌨️ 快捷键说明

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