c++一简单编程题

来源:百度知道 编辑:UC知道 时间:2024/05/31 11:33:43
照着书都会出错。。。。晕死
高手帮忙看看,谢谢了
#include <iostream.h>
main(){
struct books
{
char title[20];
char author[15];
int pages;
float price;
};
struct books zbk={"vc++","zhang","295","35.5"};
books wbk;
cout<<"zbk:"<<endl;
cout<<zbk.title<<endl;
cout<<zbk.author<<endl;
cout<<zbk.pages<<endl;
cout<<zbk.price<<endl;
cout<<"-----------------------------"<<endl;
zbk.pages+=10;
zbk.price+=0.5;
cout<<"zbk.pages="<<zbk.page<<endl;
cout<<"zbk.price="<<zbk.price<<endl;
cout<<"-------------------------------"<<endl;
cout<<"wbk.title=";
cin>>wbk.title;
cout<<"wbk.author=";
cin>>wbk.author;
cout<<"wb

#include <iostream.h>
main(){
struct books
{
char title[20];
char author[15];
int pages;
float price;
};
struct books zbk={"vc++","zhang",295,35.5};
books wbk;
cout<<"zbk:"<<endl;
cout<<zbk.title<<endl;
cout<<zbk.author<<endl;
cout<<zbk.pages<<endl;
cout<<zbk.price<<endl;
cout<<"-----------------------------"<<endl;
zbk.pages+=10;
zbk.price+=0.5;
cout<<"zbk.pages="<<zbk.pages<<endl;
cout<<"zbk.price="<<zbk.price<<endl;
cout<<"-------------------------------"<<endl;
cout<<"wbk.title=";
cin>>wbk.title;
cout<<"wbk.author=";
cin>>wbk.author;
cout<<"wbk.pages=";
cin>>wbk.