您的位置:首页 > 编程语言 > C语言/C++

描述商品信息

2016-04-03 10:51 190 查看
#include<iostream.h>
#include<string.h>
struct information{
unsigned long int id;
char name[10];
int kg;
float price;
char made[10];
int year,month,day;
int count;
}infor1,infor2;
void main()
{
information *ptr1=&infor1,*ptr2=&infor2;
cout<<"please input id,name,kg,price,made,year,month,day,count by order"<<endl;
cin>>ptr1->id>>ptr1->name>>ptr1->kg>>ptr1->price>>ptr1->made>>ptr1->year>>ptr1->month>>ptr1->day>>ptr1->count;
cout<<"this product's information is"<<ptr1->id<<'\n'<<ptr1->name<<'\n'<<ptr1->kg<<'\n'<<ptr1->price<<'\n'<<ptr1->made<<'\n'<<ptr1->year<<'\n'<<ptr1->month<<'\n'<<ptr1->day<<'\n'<<ptr1->count<<endl;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  C++ 信息描述