標題:
跑馬燈 (三)
[打印本頁]
作者:
王瑞喻
時間:
2019-11-28 01:38
標題:
跑馬燈 (三)
本帖最後由 王瑞喻 於 2019-12-28 15:29 編輯
利用跑馬燈的方式, 顯示訊息 "歡迎光臨".
[attach]7968[/attach]
本帖隱藏的內容需要回復才可以瀏覽
作者:
王建葦
時間:
2019-11-30 11:20
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1;i<13;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;
_sleep(200);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
洪藜芸
時間:
2019-11-30 11:46
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1;i<=14;i++)
{
if(i==1)
cout<<"歡";
if(i==2)
cout<<" 迎";
if(i==3)
cout<<" 光";
if(i==4)
cout<<" 臨";
if(i==5)
cout<<"歡";
if(i==6)
cout<<"歡迎";
if(i==7)
cout<<"歡迎光";
if(i==8)
cout<<"歡迎光臨";
if(i==9)
cout<<" ";
if(i==10)
cout<<"歡迎光臨";
if(i==11)
cout<<" ";
if(i==12)
cout<<"歡迎光臨";
if(i==13)
cout<<" ";
if(i==14)
cout<<"歡迎光臨";
_sleep(230);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
曾宥程
時間:
2019-11-30 11:48
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
int speed=100;
for(int i=1; i<=14; 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;
_sleep(speed);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
王翎璇
時間:
2019-11-30 11:53
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1;i<=14;i++)
{
if(i==1)
cout<<"歡";
if(i==2)
cout<<" 迎";
if(i==3)
cout<<" 光";
if(i==4)
cout<<" 臨";
if(i==5)
cout<<"歡";
if(i==6)
cout<<"歡迎";
if(i==7)
cout<<"歡迎光";
if(i==8)
cout<<"歡迎光臨";
if(i==9)
cout<<" ";
if(i==10)
cout<<"歡迎光臨";
if(i==11)
cout<<" ";
if(i==12)
cout<<"歡迎光臨";
if(i==13)
cout<<" ";
if(i==14)
cout<<"歡迎光臨";
_sleep(200);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
蔡少宇
時間:
2019-11-30 11:58
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1; i<14; i++)
{
if(i==1)
cout<<"歡";
if(i==2)
cout<<" 迎";
if(i==3)
cout<<" 光";
if(i==4)
cout<<" 臨";
if(i==5)
cout<<"歡";
if(i==6)
cout<<"歡迎";
if(i==7)
cout<<"歡迎光";
if(i==8)
cout<<"歡迎光臨";
if(i==9)
cout<<" ";
if(i==10)
cout<<"歡迎光臨";
if(i==11)
cout<<" ";
if(i==12)
cout<<"歡迎光臨";
if(i==13)
cout<<" ";
if(i==14)
cout<<"歡迎光臨";
_sleep(50);
system("cls");
goto re;
system("pause");
return 0;
}
複製代碼
作者:
鄭羽捷
時間:
2019-11-30 12:06
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1; i<=14; i++)
{
if(i==1)
cout<<"歡";
if(i==2)
cout<<" 迎";
if(i==3)
cout<<" 光";
if(i==4)
cout<<" 臨";
if(i==5)
cout<<"歡";
if(i==6)
cout<<"歡迎";
if(i==7)
cout<<"歡迎光";
if(i==8)
cout<<"歡迎光臨";
if(i==9)
cout<<" ";
if(i==10)
cout<<"歡迎光臨";
if(i==11)
cout<<" ";
if(i==12)
cout<<"歡迎光臨";
if(i==13)
cout<<" ";
if(i==14)
cout<<"歡迎光臨";
_sleep(200);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
黃傳耀
時間:
2019-12-7 10:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1; i<=14; i++)
{
if(i==1)
cout<<"歡";
if(i==2)
cout<<" 迎";
if(i==3)
cout<<" 光";
if(i==4)
cout<<" 臨";
if(i==5)
cout<<"歡";
if(i==6)
cout<<"歡迎";
if(i==7)
cout<<"歡迎光";
if(i==8)
cout<<"歡迎光臨";
if(i==9)
cout<<" ";
if(i==10)
cout<<"歡迎光臨";
if(i==11)
cout<<" ";
if(i==12)
cout<<"歡迎光臨";
if(i==13)
cout<<" ";
if(i==14)
cout<<"歡迎光臨";
_sleep(87);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
郭哲維
時間:
2019-12-7 10:06
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1;i<13;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;
_sleep(200);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
洪子涵
時間:
2019-12-7 10:53
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=-10;i<=120;i++)
{
if(i<-5)
cout<<"歡迎光臨";
else if(i<0)
cout<<" ";
else if(i<5)
cout<<"歡迎光臨";
else if(i<10)
cout<<" ";
else if(i<20)
cout<<"歡";
else if(i<30)
cout<<" 迎";
else if(i<40)
cout<<" 光";
else if(i<50)
cout<<" 臨";
else if(i<60)
cout<<"歡";
else if(i<70)
cout<<"歡迎";
else if(i<80)
cout<<"歡迎光";
else if(i<90)
cout<<"歡迎光臨";
else if(i<100)
cout<<"歡迎光";
else if(i<110)
cout<<"歡迎";
else
cout<<"歡";
_sleep(20);
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
陳宇柏
時間:
2019-12-17 17:19
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
for(int i=1; i<=14; i++)
{
if(i==1)
cout<<"歡";
if(i==2)
cout<<" 迎";
if(i==3)
cout<<" 光";
if(i==4)
cout<<" 臨";
if(i==5)
cout<<"歡";
if(i==6)
cout<<"歡迎";
if(i==7)
cout<<"歡迎光";
if(i==8)
cout<<"歡迎光臨";
if(i==9)
cout<<" ";
if(i==10)
cout<<"歡迎光臨";
if(i==11)
cout<<" ";
if(i==12)
cout<<"歡迎光臨";
if(i==13)
cout<<" ";
if(i==14)
cout<<"歡迎光臨";
_sleep(250);
system("cls") ;
}
system("pause");
return 0;
}
複製代碼
作者:
駱顗安
時間:
2020-8-27 19:22
本帖最後由 駱顗安 於 2020-8-27 19:40 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int speed=300,i=0;
//1 2 3 4 5 6 7 8 9101112131415
int a[]={1,0,0,0,1,1,1,1,0,1,0,1,0,1,0},
b[]={0,1,0,0,0,1,1,1,0,1,0,1,0,1,0},
c[]={0,0,1,0,0,0,1,1,0,1,0,1,0,1,0},
d[]={0,0,0,1,0,0,0,1,0,1,0,1,0,1,0};
while(true)
{
if(a[i%15]==1)
cout<<"歡";
else
cout<<" ";
if(b[i%15]==1)
cout<<"迎";
else
cout<<" ";
if(c[i%15]==1)
cout<<"光";
else
cout<<" ";
if(d[i%15]==1)
cout<<"臨";
else
cout<<" ";
i=i+1;
_sleep(speed);
system("cls");
}
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2