Results 1 to 4 of 4
Thread: M .
Hybrid View
-
17th December 2009 18:57 #1
M .
. . ... . , ,
:26 declaration of `Pol1::Pol1(int, int, int, int, int)' outside of class is not definition
, , , ?#include<iostream>
#include<cmath>
using namespace std;
class Pol1{
private:
int A;
int B;
int G;
int C;
int x;
public:
Pol1(int a2=0, int b2=0, int g2=0, int c2=0, int x2=0);
void set_pol(int a2, int b2, int g2, int c2, int x2);
void set_A (int a2);
void set_B (int b2);
void set_G (int g2);
void set_C (int c2);
void set_x (int x2);
//double get_pol()const;
double zzz()const;
};
Pol1::Pol1(int a2, int b2, int g2, int c2, int x2);
{ set_pol(a2, b2, g2, c2, x2); }
void Pol1::set_pol(int a2, int b2, int g2, int c2, int x2);
{ void set_A (a2);
void set_B (b2);
void set_G (g2);
void set_C (c2);
void set_x (x2); }
void Pol1::set_A(int a2);
{ A=a2; }
void Pol1::set_B(int b2);
{ B=b2; }
void Pol1::set_G(int g2);
{ G=g2; }
void Pol1::set_C(int c2);
{ C=c2; }
void Pol1::set_x(int x2);
{ x=x2; }
double Pol1::zzz()const
{ return (Ax*Ax*Ax)+(Bx*Bx)+Gx+C; }
int main()
{
Pol1 p;
int a;
int b;
int g;
int c;
int x;
cout<<"programata iz4islqva polinom ot vida Ax*Ax*Ax+Bx*Bx+Gx+C"<<endl;
cout<<"vavedete A "; cin>>a; p.set_A(a);
cout<<"vavedete B "; cin>>b; p.set_B(b);
cout<<"vavedete G "; cin>>g; p.set_G(g);
cout<<"vavedete C "; cin>>c; p.set_C(c);
cout<<"vavedete x "; cin>>x; p.set_x(x);
cout<<"sumata na polinoma e : "<<p.zzz(a,b,g,c,x);
system("pause");
return 0;
}
edit: , . , Code::Blocks .
, , .Last edited by HardDrive; 17th December 2009 at 19:21.
Config: Ryzen 3700x / Gigabyte x570 Gaming X / RX480 Strix 1400@2250 / 2x8gb Corsair Vengeance / Seagate Barracuda 1Tb + 256gb OCZ Trion / SuperFlower Leadex II Gold 750w / BeQuiet B801 / LG 23MA53 + Philips 170c / Logitech G502 / CM QuickFire TK
Acer Predator G9-593 I7 7700HQ + GTX1070
-
17th December 2009 19:12 #2
-
17th December 2009 19:46 #3Registered User
Join Date: Feb:2006
Location: Plovdiv
Posts: 392
.. , . -
..Code:#include<iostream> using namespace std; class Poli { public : int A; int B; int G; int C; public: Poli(int a=0, int b=0, int g=0, int c=0):A(a), B(b), G(g), C(c){}; double zzz(int x)const { return A*(x*x*x)+ B * (x*x)+ G*x+C; } }; int main() { Poli p; int x; cout<<"programata iz4islqva polinom ot vida Ax*Ax*Ax+Bx*Bx+Gx+C"<<endl; cout<<"vavedete A "; cin>>p.A; cout<<"vavedete B "; cin>>p.B; cout<<"vavedete G "; cin>>p.G; cout<<"vavedete C "; cin>>p.C; cout<<"vavedete x "; cin>>x; cout<<"sumata na polinoma e : "<<p.zzz(x); system("pause"); return 0; }
; , void-a zzz .
-
21st December 2009 23:13 #4
Me ,
Config: Ryzen 3700x / Gigabyte x570 Gaming X / RX480 Strix 1400@2250 / 2x8gb Corsair Vengeance / Seagate Barracuda 1Tb + 256gb OCZ Trion / SuperFlower Leadex II Gold 750w / BeQuiet B801 / LG 23MA53 + Philips 170c / Logitech G502 / CM QuickFire TK
Acer Predator G9-593 I7 7700HQ + GTX1070




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in