#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int x;
cout<<"<小米的腦殘問答>"<<endl;
cout<<"請問豬有幾隻腳?<1>一隻<2>兩隻<3>三隻<4>四隻"<<endl;
re:
cout<<"請作答";
cin>>x;
switch(x)
{case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬肉也看過豬走路!"<<endl;
break;
case 3:
cout<<"你是豬啊?"<<endl;
break;
case 4:
cout<<"答對了!"<<endl;
break;
default:
cout<<"輸入錯誤"<<endl;
break;
}
goto re;
system("pause");
return 0;
}作者: 劉奕劭 時間: 2024-6-8 15:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int ans;
cout<<"小米的腦殘問答!"<<endl;
cout<<"請問豬有幾隻腳?(1)一隻(2)二隻(3)三隻(4)四隻"<<endl;
cout<<"請作答"<<endl;
cin>>ans;
switch(ans)
{
case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬肉也看過豬走路!"<<endl;
break;
case 3:
cout<<"你是豬啊?"<<endl;
break;
case 4:
cout<<"答對了!"<<endl;
break;
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int option;
re:
cout<<"請問豬有幾隻腳?(1)一隻(2)二隻(3)三隻(4)四隻"<<endl;
cin>>option;
switch(option){
case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬肉也看過豬走路!"<<endl;
break;
case 3:
cout<<"你是豬啊?"<<endl;
break;
case 4:
cout<<"正確"<<endl;
break;
default:
cout<<"輸入錯誤"<<endl;
break;
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int ans;
re:
cout<<"小米的腦殘問答!"<<endl;
cout<<"請問豬有幾隻腳?(1)一隻(2)兩隻(3)三隻(4)四隻"<<endl;
cout<<"請作答!"<<endl;
cin>>ans;
switch(ans){
case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬肉也看過豬走路!"<<endl;
break;
case 3:
cout<<"你是豬啊?"<<endl;
break;
case 4:
cout<<"答對了!"<<endl;
break;
default:
cout<<"輸入錯誤!"<<endl;
break;
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int answer;
cout<<"<小米的腦殘問答>"<<endl;
cout<<"請問豬有幾隻腳?<1>1隻?<2>2隻<3>3隻<4>4隻"<<endl;
re:
cout<<"請作答";
cin>>answer;
switch(answer){
case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬也看過豬走路"<<endl;
break;
case 3:
cout<<"你是豬啊?"<<endl;
break;
case 4:
cout<<"答對了!"<<endl;
break;
}
cout<<endl;
goto re;
system ("pause");
return 0;
}作者: 林少謙 時間: 2024-6-8 15:44
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout<<"<腦殘問答>"<<endl;
re:
int x;
cout<<"請問豬有幾隻腳?<1>一隻<2>兩隻<3>三隻<4>四隻"<<endl;
cout<<"請作答:";
cin>>x;
switch (x)
{
case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬肉也看過豬走路!"<<endl;
break;
case 3:
cout<<"你是豬?"<<endl;
break;
case 4:
cout<<"恭喜答對"<<endl;
break;
default:
cout<<"沒這選項 重選"<<endl;
}
cout<<endl;
goto re;
system("pause");
return 0;
}作者: 洪榮辰 時間: 2024-6-8 15:50
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
int option;
cout<<"<小米的腦殘問題>"<<endl;
cout<<"請問豬有幾隻腳? (1)一隻(2)二隻(3)三隻(4)四隻"<<endl;
cout<<"請作答:";
cin>>option;
switch(option)
{
case 1:
cout<<"用跳的嗎?"<<endl;
break;
case 2:
cout<<"沒吃過豬肉也看過豬走路!"<<endl;
break;
case 3:
cout<<"你是豬啊?"<<endl;
break;
case 4:
cout<<"答對了!"<<endl;
break;
default:
cout<<"輸入錯誤!"<<endl;
}
cout<<endl;
goto re;
system("pause");
return 0;
}
複製代碼
作者: 陳妍蓁 時間: 2024-6-8 15:54
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
char answer;
cout<<"<小米的腦殘問答>"<<endl;
cout<<"請問豬有幾隻腳?<A>1隻?<B>2隻<C>3隻<D>4隻"<<endl;
re:
cout<<"請作答";
cin>>answer;
switch(answer){
case 'A':
case 'a':
cout<<"用跳的嗎?"<<endl;
break;
case 'B':
case 'b':
cout<<"沒吃過豬也看過豬走路"<<endl;
break;
case 'C':
case 'c':
cout<<"你是豬啊?"<<endl;
break;
case 'D':
case 'd':
cout<<"答對了!"<<endl;
break;
default:
cout<<"輸入錯誤"<<endl;
break;