#include <iostream> using namespace std; class Box { private: int height; int weight; int length; public: Box(int a,int b,int c):height(a),weight(b),length(c){} int s(); }; int Box::s() { int d; d = height * length * weight; return d; } int main() { Box b1(3, 4, 5); cout<<b1.s()<<endl; return 0; }
阿西,好简单