Home > Back-end >  C the couple consult why application error how to modify the program
C the couple consult why application error how to modify the program

Time:03-22

#include
using namespace std;
The class Circle
{
Double r;
Public:
Void the Show ()
{
Cout<" Area="& lt; <3.14 * r * r}
Computer ()
{
R=10;
}
Computer (double a)
{
R=a;
}
};
Int main ()
{
Double r1.
Cin> R1.
Circle a, b (r1);
A.S how ();
B.S how ();
return 0;
}

CodePudding user response:

Reference:
 # include & lt; iostream> 
using namespace std;
The class Circle
{
Private:
Double r;
Public:
Void the Show ()
{
Cout<" Area="& lt; <3.14 * r * r}
Circle ()//computer ()//class constructor name and the name of the class is the same as
{
R=10;
}
Circle (double) a//computer (double a)
{
R=a;
}
};

Int main ()
{
Double r1.
Cin> R1.
Circle a, b (r1);
A.S how ();
B.S how ();

return 0;
}
  • Related