using namespace std;
#include<iostream>
#include<math.h>
#include<stdio.h>
#include<conio.h>
class hinhchunhat
{
private:
float cd,cr;
public:
void nhap()
{
cout<<"nhap chieu dai:";
cin>>cd;
cout<<"nhap chieu rong:";
cin>>cr;
}
void xuat()
{
cout<<"chieu dai la:"<<cd<<endl;
cout<<"chieu rong la:"<<cr<<endl;
}
int chuvi()
{
float cv;
cv=(cd+cr)*2;
return cv;
}
int dientich()
{
float dt;
dt=cd*cr;
return dt;
}
};
main()
{
hinhchunhat hcn;
hcn.nhap();
hcn.xuat();
cout<<"\ndien tich hcn la:"<<hcn.dientich();
cout<<"\nchu vi hcn la:"<<hcn.chuvi();
getch();
}
dXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPG1hdGguaD4KI2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8Y29uaW8uaD4KY2xhc3MgaGluaGNodW5oYXQKewoJcHJpdmF0ZToKCQlmbG9hdCBjZCxjcjsKCXB1YmxpYzoKCQl2b2lkIG5oYXAoKQoJCXsKCQkJY291dDw8Im5oYXAgY2hpZXUgZGFpOiI7CgkJCWNpbj4+Y2Q7CgkJCWNvdXQ8PCJuaGFwIGNoaWV1IHJvbmc6IjsKCQkJY2luPj5jcjsKCQl9CgkJdm9pZCB4dWF0KCkKCQl7CgkJY291dDw8ImNoaWV1IGRhaSBsYToiPDxjZDw8ZW5kbDsKCQljb3V0PDwiY2hpZXUgcm9uZyBsYToiPDxjcjw8ZW5kbDsKCSAgICB9CgkgIGludCBjaHV2aSgpCgkgICAgewoJICAgIAlmbG9hdCBjdjsKCSAgICAJY3Y9KGNkK2NyKSoyOwoJICAgIAlyZXR1cm4gY3Y7CgkgICAgfQoJICAgIGludCBkaWVudGljaCgpCgkgICAgewoJICAgIAlmbG9hdCBkdDsKCSAgICAJZHQ9Y2QqY3I7CgkgICAgCXJldHVybiBkdDsKCSAgICB9Cn07Cm1haW4oKQp7CgloaW5oY2h1bmhhdCBoY247CgloY24ubmhhcCgpOwoJaGNuLnh1YXQoKTsKCWNvdXQ8PCJcbmRpZW4gdGljaCBoY24gbGE6Ijw8aGNuLmRpZW50aWNoKCk7Cgljb3V0PDwiXG5jaHUgdmkgaGNuIGxhOiI8PGhjbi5jaHV2aSgpOwoJZ2V0Y2goKTsKfQ==
Main.java:1: error: class, interface, or enum expected
using namespace std;
^
Main.java:2: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: class, interface, or enum expected
#include<iostream>
^
Main.java:3: error: illegal character: '#'
#include<math.h>
^
Main.java:4: error: illegal character: '#'
#include<stdio.h>
^
Main.java:5: error: illegal character: '#'
#include<conio.h>
^
Main.java:8: error: illegal start of type
private:
^
Main.java:8: error: ';' expected
private:
^
Main.java:9: error: <identifier> expected
float cd,cr;
^
Main.java:10: error: illegal start of type
public:
^
Main.java:10: error: ';' expected
public:
^
Main.java:11: error: invalid method declaration; return type required
void nhap()
^
Main.java:13: error: not a statement
cout<<"nhap chieu dai:";
^
Main.java:14: error: not a statement
cin>>cd;
^
Main.java:15: error: not a statement
cout<<"nhap chieu rong:";
^
Main.java:16: error: not a statement
cin>>cr;
^
Main.java:20: error: not a statement
cout<<"chieu dai la:"<<cd<<endl;
^
Main.java:21: error: not a statement
cout<<"chieu rong la:"<<cr<<endl;
^
Main.java:36: error: class, interface, or enum expected
main()
^
Main.java:39: error: class, interface, or enum expected
hcn.nhap();
^
Main.java:40: error: class, interface, or enum expected
hcn.xuat();
^
Main.java:41: error: class, interface, or enum expected
cout<<"\ndien tich hcn la:"<<hcn.dientich();
^
Main.java:42: error: class, interface, or enum expected
cout<<"\nchu vi hcn la:"<<hcn.chuvi();
^
Main.java:43: error: class, interface, or enum expected
getch();
^
Main.java:44: error: class, interface, or enum expected
}
^
25 errors