c++代码!!

来源:百度知道 编辑:UC知道 时间:2024/06/16 03:44:07
#include <iostream>
int main(){
int smoking(int);
int nonsmoking(int);
int chose;
while (true){
cout <<"type 1 for smoking"<<endl;
cout <<"type 2 for nonsmoking"<<endl;
cout<<"type 0 for exit"<<endl;

cin >> chose ;
if (chose == 1){
smoking (int chose);
}else if (chose == 2){
nonsmoking(int chose);

}else if (chose == 0)
break;
else if (chose != 0 && chose != 1 && chose != 2)
cout <<"wrong input"<<endl;
}

return 0;

}
int smoking(int i){
int j,a[],m;
for (j=1;j<5;j++){
for (m=0;m<j;m++){
a[m] = 1;
}
if (m<5){
cout <<"you has chose the 1"<<endl;
cout <<"your seat is "<< m+1 << endl;
}
if (m=5)

#include "iostream.h"

int smoking(int);
int nonsmoking(int);

int main(int argc, char* argv[])
{
int chose;
while (true)
{
cout <<"type 1 for smoking"<<endl;
cout <<"type 2 for nonsmoking"<<endl;
cout<<"type 0 for exit"<<endl;
cin >> chose ;
if (chose == 1)
{
smoking (chose);
}
else if (chose == 2)
{
nonsmoking(chose);
}
else if (chose == 0)
break;
else
cout <<"wrong input"<<endl;
}
return 0;
}

int smoking(int i)
{
int j,a[50],m;
for (j=1;j<5;j++)
{
for (m=0;m<j;m++)
{
a[m] = 1;
}
if (m<5)
{
cout <<"you has chose the 1"<<endl;
cout <<"your s