Skip to content

Instantly share code, notes, and snippets.

@hansen033
Last active October 19, 2017 23:08
Show Gist options
  • Save hansen033/46778aa27a4fe135d1f78541c50e2515 to your computer and use it in GitHub Desktop.
Save hansen033/46778aa27a4fe135d1f78541c50e2515 to your computer and use it in GitHub Desktop.
2017.10.19 加分題
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a, b, c, m, n, z;
cout <<"方程式: y=a*x*x+b*x+c\n";
cout <<"請輸入方程式中的a:\n";
cin >> a;
cout <<"請輸入方程式中的b:\n";
cin >> b;
cout <<"請輸入方程式中的c:\n";
cin >> c;
z=(b/2/a);
m=z*-1;
n=c-(z*z*a);
cout <<"你輸入的方程式: y=" << a << "x*x+" << b << "x+" << c <<"的頂點是: (" << m << "," << n << ")";
cout <<"\n\n感謝您的使用,再見!";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment