看板 Programming 關於我們 聯絡資訊
#include <iostream> #include <stdlib.h> using namespace std; class fraction{ private: int numerator; int denominator; public: void set_value() {cout << "輸入分子:"; cin >> numerator; cout << "輸入分母:"; cin >> denominator; } void print_value() { //new try { cout << numerator << "/" << denominator << "="; cout << (numerator/denominator) << endl; ; } catch (std::exception& e) { cout << "例外發生: " << e.what() << endl; }} }; int main() { fraction X; X.set_value(); X.print_value(); system("pause"); return 0;} -- ┌─────KKCITY─────┐  找歌最方便 KKBOX 歌詞搜尋!! bbs.kkcity.com.tw \^_^ / http://www.kkbox.com.tw └──From:140.109.139.90 ──┘   唱片公司授權,音樂盡情下載 --
revivalworld:... 60.244.252.15 07/07 20:09