热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_74368555
轻言行风
3 年前
trueweixin_74368555

#include<iostream>
using namespace std;
class Stock
{
public:
Stock(string x,int y=1000,double z=8.98);
void printf()
{
cout<<"stockcode:"<<stockcode<<" quantity:"<<quantity<<" price:"<<price<<endl;
}
private:
string stockcode;
int quantity;
double price;
};
Stock::Stock(string x,int y,double z)
{
stockcode=x;
quantity=y;
price=z;
}
int main(){
Stock a("600001",3000,5.67),b("600001");
a.printf();
b.printf();
return 0;
}

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
那些听不见音乐的人认为那些跳舞的人疯了
立即登录