這個那兒錯呢?? 要改哪裡??
#include<iostream>
#include<cstdlib>
using namespace std;
class crectangle
{
int width;
int height;
}
int main(void)
{
crectangle rect1;
rect1.width=15;
rect2.height=10;
cout<<"面積為"<<rect1.w*rect1.h;
}
system("pause");
return 0;
1 個解答
評分
- HelloLv 41 0 年前最佳解答
這是修改過的
#include<iostream>
#include<cstdlib>
using namespace std;
class crectangle
{
public:
int width;
int height;
};
int main(void)
{
crectangle rect1;
rect1.width=15;
rect1.height=10;
cout<<"面積為: "<<rect1.width*rect1.height<<endl;
return 0;
}
參考資料: my learning
還有問題?馬上發問,尋求解答。