如題 為什麼我送出去的C++程式碼這麼大?
別人的好像都幾百Kb
為什麼我的會到2.3mb?
這是我a006的程式碼...
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a , b , c ,d;
double x1 , x2 ;
cin>> a >> b >> c;
d = (b * b) - (4 * a * c);
if ( d == 0 )
{
x1 = (-b) /(2*a);
if (x1 == 0)
{
x1 == 0;
}
cout << "Two same roots x=" << x1 <<endl;
}
else if (d > 0)
{
x1 = (-b + sqrt(d))/(2*a);
x2 = (-b - sqrt(d))/(2*a);
cout << "Two different roots x1=" <<x1 << " , x2=" << x2<< endl ;
}
else
{
cout << "No real root" <<endl ;
}
system("pause");
}
如題 為什麼我送出去的C++程式碼這麼大?
別人的好像都幾百Kb
為什麼我的會到2.3mb?
這是我a006的程式碼...
#include
#include
using namespace std;
int main()
{
int a , b , c ,d;
double x1 , x2 ;
cin>> a >> b >> c;
d = (b * b) - (4 * a * c);
if ( d == 0 )
{
x1 = (-b) /(2*a);
if (x1 == 0)
{
x1 == 0;
}
cout << "Two same roots x=" << x1 < }
else if (d > 0)
{
x1 = (-b + sqrt(d))/(2*a);
x2 = (-b - sqrt(d))/(2*a);
cout << "Two different roots x1=" < }
else
{
cout << "No real root" < }
return 0; /*return 0; 代替 system("pause");*/
}