#include <iostream>
#include <string>
using namespace std;
int main()
{
struct CandyBar
{
char name[20];
float weight;
int calorie;
};
CandyBar snack=
{
"Mocha Munch",
2.3,
350
};
cout<<"name: "<<snack.name<<endl;
cout<<"weight: "<<snack.weight<<endl;
cout<<"calorie: "<<snack.calorie<<endl;
getchar();
}
C++Primer Plus第六版答案4.13.5
最新推荐文章于 2022-04-01 16:33:57 发布