Skip to content

Instantly share code, notes, and snippets.

@hansen033
Last active October 19, 2017 13:58
Show Gist options
  • Save hansen033/4401baccc3cfd04be2d81e7db64c456d to your computer and use it in GitHub Desktop.
Save hansen033/4401baccc3cfd04be2d81e7db64c456d to your computer and use it in GitHub Desktop.
2017.10.19
#include <iostream>
using namespace std;
int main()
{
int a, b, c, x, y;
cout <<"方程式: y=a*x*x+b*x+c\n";
cout <<"請輸入方程式中的a\n";
cin >> a;
cout <<"請輸入方程式中的b\n";
cin >> b;
cout <<"請輸入方程式中的c\n";
cin >> c;
cout <<"你輸入的方程式是: y=" << a <<"x*x+" << b << "x+" << c;
cout <<"\n\n請輸入方程式中的x\n";
cin >> x;
cout <<"請輸入方程式中的y\n";
cin >> y;
if (y==a*x*x+b*x+c){
cout <<"你輸入的: x=" << x <<" y=" << y <<" 在 y=" << a <<"x*x+" << b << "x+" << c <<"上\n";
} else {
cout <<"你輸入的: x=" << x <<" y=" << y <<" 不在 y=" << a <<"x*x+" << b << "x+" << c <<"上";
}
cout <<"\n\n感謝您的使用,再見!";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment