add cin input

master
IoTgod 5 years ago
parent f8c5148d84
commit a058b918d2
  1. 9
      as1/Fraction_test.cpp
  2. BIN
      as1/a.exe

@ -13,6 +13,7 @@ int main()
Fraction f = -b;
cout << "Output in Fraction Form: " << endl;
cout << "a: " << a << endl;
cout << "b: " << b << endl;
@ -97,5 +98,13 @@ int main()
cout << msg << endl;
}
try{
cout << endl << "Please Input a Fraction(-3/5) or a Decimals(e.g. 3.14): ";
cin >> a;
cout << a << endl;
}catch(const char* msg){
cout << endl << msg << endl;
}
return 0;
}

Binary file not shown.
Loading…
Cancel
Save