热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_74368555
轻言行风
2 年前
trueweixin_74368555

4.26(省略很多)
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
class toy{
private:
int number,price,total;
public:
toy(int x,int y)
{
number=y;
price=x;
total=price*number;
}
void final_money()
{
cout<<total<<endl;
}
};
int main(){
toy a[5]={toy(3,1240),toy(53,645),toy(198,30),toy(398,14),toy(569,5)};
int i;
for(i=0;i<5;i++)
{
a[i].final_money();
}
return 0;
}

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
https://blog.csdn.net/qq_38636482/article/details/125748015STM32以太网通信-LWIP简介
立即登录