#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
struct CandyBar
{
char brand[20];
double weight;
int calorie;
};
int main()
{
CandyBar snack[3]
{
{ "Mocha Munch", 2.3, 350 },
{"Big rabbit",3,200},
{ "Alps",4,500 }
};
for (int(i) = 0; i < 3; i++)
{
cout << "name is: " << snack[i].brand << endl;
cout << "weight is: " << snack[i].weight << endl;
cout << "carolie is: " << snack[i].calorie << endl;
}
return 0;
}
4.6
最新推荐文章于 2024-10-28 09:41:07 发布