主 题: 请教好心人
已阅:330 / 回复:3(楼主)
你好!请教下面
struct date
{
int year;
int month;
int day;
};
struct book
{
char name[20];
int ID;
int price;
    date publicdate;
};

void add(book a[20],int &num);
void sum(book a[20],const int &sum);
void mostexpensive(book a[20],const int &num);
void putdown(book a[20],int &num);
void exit ();


#include <iostream>
using namespace std;
int main ()
{
bool flag = 1;
while ( flag )
{
int choice;

book basket[20];
int n = 0;

cout << "选择一下功能\\n1.添加一本书.\\n2.放下一本书.\\n3.查询最贵的书.\\n4.查询当前书篮中书的总价.\\n5.退出\\n";
do
{
cin >> choice;
}
while (choice < 1 || choice > 5);
switch ( choice )
{
case 1:add(basket,n); break;
case 2:putdown(basket,n); break;
case 3:mostexpensive(basket,n); break;
case 4:sum(basket,n); break;
case 5:flag = 0; break;
default:cout << "error!!!!";
}
}
return 0;
}

void add(book a[20],int &num)
{
cout << "输入书的名字,ID,价格,出版日期。\\n";
cin >> a[num].name >> a[num].ID >> a[num].price >> a[num].publicdate.year >> a[num].publicdate.month >> a[num].publicdate.day;
num ++;
}

void putdown(book a[20],int &num)
{
char bookname[20];
bool flag = false;
int i,j,k;

cout << "输入书的名字\\n";
cin >> bookname;

for (i=0;i<num&&(!flag);i++)
{
for (k=0;k<20;k++)  
{
if (bookname[k] == a[i].name[k]) //if (strcmp(bookname , a[i].name ) == 0)
{
flag = true;

}
else {flag = false;
break;}
}
}
if (flag)
{
for ( j = i; j < 20; j-- )
a[j] = a [j+1];
num --;
}
else
cout << "您并没有选择过该书!\\n";
}

void mostexpensive(book a[20],const int &num)
{
int i;
int max,m;
cout << "查询出最贵的书。\\n";
max = a[0].price;

for ( i = 1; i < num; i++)
{
if (a[i].price > max)
{
m = i;
max = a[i].price;
}
}
cout << "名字:" << a[m].name << "ID:" << a[m].ID << "价格:" << a[m].price
<< "出版日期:" << a[m].publicdate.year << "-" << a[m].publicdate.month
<< "-" << a[m].publicdate.day;

}

void sum(book a[20],const int &num)
{
int i;
int booksum = 0;
for ( i= 0; i < num; i++)
{
booksum = booksum + a[i].price;
}
cout << booksum;
}
怎么运行的有问题

作者:lightleafs (2010-1-3 23:14:12)
回复:请教好心人
第 1 楼
star trek online cd key
star trek cd key
buy star trek online cdkey
star trek game card
sto game card
buy star trek cd key
star trek cdkey
buy star trek online cd key
star trek online game card
buy sar trek game card
buy sar trek cdkey
star trek energy credits
sto energy credits
sto gold
buy star trek energy credits
star trek online gold
cheap sto gold
star trek online power leveling
sto powerleveling
sto power level
cheap sto power leveling
buy star trek power leveling
star trek power leveling
star trek online accounts
sto account
buy star trek online account
cheap sto accounts
star trek account for sale
buy sto energy credits
buy star trek online gold
cheap sto gold
cheap star trek gold
star trek gold for sale
buy sto gold
star trek online account
sto accounts
buy sto accounts
star trek accounts for sale
cheap star trek online account
star trek power leveling
star trek online power leveling
star trek powerleveling
buy cheap star trek power leveling
ffxiv gil
final fantasy xiv gil
buy ffxiv gil
cheap ffxiv gil
ffxiv gil for sale
ffxiv accounts
final fantasy xiv account
buy ffxiv account
buy final fantasy xiv account ffxiv power leveling
buy ffxiv powerleveling final fantasy xiv power leveling
ffxiv leveling
ffxiv cd key
final fantasy xiv cd key
ffxiv time card
buy ffxiv game card
buy ffxiv cd key
guild wars 2 gold
gw2 gold
buy gw2 gold
cheap gw2 gold
gw2 gold for sale
gw2 accounts
buy gw2 account
guild war 2 accounts for sale
gw2 power leveling
buy gw2 power leveling
cheap guild wars 2 power leveling
guild wars 2 cd key
gw2 cd key
buy gw2 cd key
gw2 time card
buy gw2 time card
aion gold
aion kina
aion kinah
aion power leveling  
aion time card  
aion cd key
aion accounts
buy aion gold  
cheap aion gold
cheap wow gold   
wow power leveling
wowcdkey wow cd key
aion gold
aion kina
buy aion gold
aion power leveling
wow  power leveling
buy wow power leveling
cheap wow power leveling
cheap wow gold
Ugg Boots
cataclysm cd key
wow cataclysm cd key
buy wow cataclysm cd key
buy wow cataclysm key
star trek gold
sto gold
buy star trek gold
star trek power leveling
aion power leveling
aion cd key
aion time card
aion kina
aion cd  key  
aion power leveling
aion gold  
aion kina
aion  guides
buy aion gold
aion  gold  
buy aion gold
aion kina
wow gold
buy wow gold
cheap wow gold

buy cheap wow gold
wow gold for sale
buying wow gold
world of warcraft power leveling
buy wow leveling
wotlk powerleveling
buy cheap wow power leveling
wow gold
buy wow gold
cheapest wow gold
world of warcraft gold
wow powerleveling
buy world of warcraft power leveling
wotlk power leveling
wow leveling

作者:aioncdkey (2010-3-15 17:00:54)
回复:请教好心人
第 2 楼

So what can wow power leveling you do right now to make progress and get your book done? Start with one small wow power leveling thing. Pull out your calendar and schedule an hour of writing time. Take twenty minutes to brainstorm aion power level everything you want to cover in your book. Flip to a fresh page in your journal, let wow power leveling your imagination go, and free-write your big vision for your book-including celebrity endorsements, national aion powerleveling TV appearances, and raving book reviews. One respondent even said she'd aion powerleveling never had a shortage of clients since writing and publishing her book. These cheap aion power leveling statistics have been out for a year or so, but they're still amazing! Particularly wow power leveling when self-employed professionals, coaches, and consultants are buy wow gold looking for ways ensure long-term success for their business.

作者:zlzqq (2010-7-6 9:28:36)
Ghd Hair Straightener
第 3 楼
        Reporter was informed from Christian Louboutin Sale the provincial Department Ghd
of education today, 2010 Fujian adult enrollment still take online registration, sign up for the work is divided into Ghd Hair Straightener online information input and onsite information confirms that the two stages. The exam will be held on October 16, 17.
First stage: candidates through the Christian Louboutin recruitment of landing information network in Fujian province, the country, in accordance with the requirements of a Web page, prompts and enter your personal registration information accurately and choose the exam venue. Time is 10 August-30 August.
        Second stage: the candidates according to the selected time, to confirm the selected information, information about formalities scene: submit proof of relevant documents, and a copy of the payment of Christian Louboutinr egistration fees, examination of Ghd Straighteners electronic camera, confirm the application information. Where no on-site Ghd Hair Straighteners candidates whose qualifications online registration is not valid. Time for the September Christian Louboutin Wedding Shoes 1-September 7.
This reporter has Ghd Straighteners Ireland learned that the 2010 adult enrollment of all computers on the Internet. Taking of evidence and work concentrated shoes louboutin  tonic taken christian louboutin booties  two phases. Take time to focus buy christian louboutin  on 23 November to christian louboutin glitter  2 December, according to the admitted candidates to fill volunteer.
Online volunteer discount louboutin time or declarations on December 5 to 7 February. Take time to Supplement 9 to 10 may, according to the candidates ' online report Christian Louboutin Shoes after the event, additional volunteers.
Candidates complete the volunteer should pay attention to.
Vincent Carter
Carmelo Anthony
Dwane Wade
Steven Nash
Shaquile O’Neal
Tony Parker
Tim Duncan
George Washington
Theodore Roosevelt
George Bush
个性签名
Ghd Hair Straightener....
作者:77779999 (2010-7-23 14:45:16)
当前总数:3 每页50条 当前1/1页 [1 



目前不允许游客回复,请 登录 注册 发贴.