C++语言开发示例:15. 结构体
structur.cpp
#include <iostream>
struct inflatable
{
char name[20];
float volume;
double price;
};
int main()
{
using namespace std;
inflatable guest = {
"Glorious Gloria",
1.88,
29.99};
inflatable pal = {
"Audancious Arthur",
3.12,
32.99};
cout << "Expand your guest list with " << guest.name;
cout << " and " << pal.name << "!\n";
cout << "You can have both for $";
cout << guest.price + pal.price << "!\n";
} 最后更新于1年前
本文由人工编写,AI优化,转载请注明原文地址: C++语言开发示例:15. 结构体
推荐阅读
评论 (0)
发表评论
昵称:加载中...
暂无评论,快来发表第一条评论吧!