標題:
[作業] 跑馬燈 (四)
[打印本頁]
作者:
方浩葦
時間:
2024-7-13 07:27
標題:
[作業] 跑馬燈 (四)
利用跑馬燈,顯示訊息 "歡迎光臨",變換方式如附件。
歡迎光臨.exe
本帖隱藏的內容需要回復才可以瀏覽
作者:
鄭豊翰
時間:
2024-7-13 11:29
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int speed=500;
re:
for(int i=1; i<=15; i++)
{
if(i==1)
cout<<"歡 "<<endl;
if(i==2)
cout<<" 迎 "<<endl;
if(i==3)
cout<<" 光 "<<endl;
if(i==4)
cout<<" 臨"<<endl;
if(i==5)
cout<<"歡 "<<endl;
if(i==6)
cout<<"歡迎 "<<endl;
if(i==7)
cout<<"歡迎光 "<<endl;
if(i==8)
cout<<"歡迎光臨"<<endl;
if(i==9)
cout<<" "<<endl;
if(i==10)
cout<<"歡迎光臨"<<endl;
if(i==11)
cout<<" "<<endl;
if(i==12)
cout<<"歡迎光臨"<<endl;
if(i==13)
cout<<" "<<endl;
if(i==14)
cout<<"歡迎光臨"<<endl;
if(i==15)
cout<<" "<<endl;
_sleep(speed);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
邱博宥
時間:
2024-8-11 16:37
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
re:
for(int a=1; a<=14; a++)
{
if (a==1)
cout<<"歡 "<<endl;
if (a==2)
cout<<" 迎 "<<endl;
if (a==3)
cout<<" 光 "<<endl;
if (a==4)
cout<<" 臨"<<endl;
if (a==5)
cout<<"歡 "<<endl;
if (a==6)
cout<<"歡迎 "<<endl;
if (a==7)
cout<<"歡迎光 "<<endl;
if (a==8)
cout<<"歡迎光臨"<<endl;
if (a==9)
cout<<" "<<endl;
if (a==10)
cout<<"歡迎光臨"<<endl;
if (a==11)
cout<<" "<<endl;
if (a==12)
cout<<"歡迎光臨"<<endl;
if (a==13)
cout<<" "<<endl;
if (a==14)
cout<<"歡迎光臨"<<endl;
_sleep(200);
system("cls");
}
goto re;
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2