標題:
[作業] 跑馬燈 (四)
[打印本頁]
作者:
tonyh
時間:
2015-6-13 11:51
標題:
[作業] 跑馬燈 (四)
本帖最後由 tonyh 於 2015-6-27 11:36 編輯
使文字訊息在畫面上反覆地左右移動.
[attach]1280[/attach]
本帖隱藏的內容需要回復才可以瀏覽
作者:
李知易
時間:
2015-6-13 12:16
本帖最後由 李知易 於 2015-6-27 11:48 編輯
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
re:
for(int i=1;i<=240;i++)
{
if(i<=120)
{
for(int j=0;j<=i;j+=2)
cout<<" ";
}else
{
for(int j=0;j<=240-i;j+=2)
cout<<" ";
}
cout<<"新年快樂";
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
作者:
謝瀞儀
時間:
2015-6-14 17:15
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
allre:
for(int i=1;i<=270;i++)
{
if(i>=1 and i<11)
cout<<"◇"<<endl;
if(i>=11 and i<21)
cout<<"◇◆"<<endl;
if(i>=21 and i<31)
cout<<"◇◆◇"<<endl;
if(i>=31 and i<41)
cout<<"◇◆◇歡"<<endl;
if(i>=41 and i<51)
cout<<"◇◆◇歡迎"<<endl;
if(i>=51 and i<61)
cout<<"◇◆◇歡迎光"<<endl;
if(i>=61 and i<71)
cout<<"◇◆◇歡迎光臨"<<endl;
if(i>=71 and i<81)
cout<<"◇◆◇歡迎光臨◇"<<endl;
if(i>=81 and i<91)
cout<<"◇◆◇歡迎光臨◇◆"<<endl;
if(i>=91 and i<101)
cout<<"◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=101 and i<111)
cout<<"◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=111 and i<121)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=121 and i<131)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=131 and i<141)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=141 and i<151)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=151 and i<161)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=161 and i<171)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=171 and i<181)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=181 and i<191)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=191 and i<201)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=201 and i<211)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=211 and i<221)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=221 and i<231)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=231 and i<241)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=241 and i<251)
cout<<" ◆◇◆歡迎光臨◆◇◆"<<endl;
if(i>=251 and i<261)
cout<<" ◇◆◇歡迎光臨◇◆◇"<<endl;
if(i>=261 and i<271)
cout<<"◆◇◆歡迎光臨◆◇◆"<<endl;
system("cls");
}
goto allre;
system("pause");
return 0;
}
複製代碼
作者:
謝瀞儀
時間:
2015-6-14 17:26
本帖最後由 謝瀞儀 於 2015-6-14 17:56 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
allre:
for(int i=1;i<=150;i++)
{
if(i>=1 and i<11)
cout<<"歡迎光臨"<<endl;
if(i>=11 and i<21)
cout<<" 歡迎光臨"<<endl;
if(i>=21 and i<31)
cout<<" 歡迎光臨"<<endl;
if(i>=31 and i<41)
cout<<" 歡迎光臨"<<endl;
if(i>=41 and i<51)
cout<<" 歡迎光臨"<<endl;
if(i>=51 and i<61)
cout<<" 歡迎光臨"<<endl;
if(i>=61 and i<71)
cout<<" 歡迎光臨"<<endl;
if(i>=71 and i<81)
cout<<" 歡迎光臨"<<endl;
if(i>=81 and i<91)
cout<<" 歡迎光臨"<<endl;
if(i>=91 and i<101)
cout<<" 歡迎光臨"<<endl;
if(i>=101 and i<111)
cout<<" 歡迎光臨"<<endl;
if(i>=111 and i<121)
cout<<" 歡迎光臨"<<endl;
if(i>=121 and i<131)
cout<<" 歡迎光臨"<<endl;
if(i>=131 and i<141)
cout<<" 歡迎光臨"<<endl;
if(i>=141 and i<151)
cout<<"歡迎光臨"<<endl;
system("cls");
}
goto allre;
system("pause");
return 0;
}
複製代碼
作者:
謝瀞儀
時間:
2015-6-14 17:30
好一點但還是很奇怪
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
allre:
for(int i=1;i<=150;i++)
{
if(i>=1 and i<11)
cout<<"歡迎光臨";
if(i>=11 and i<121)
cout<<" 歡迎光臨";
if(i>=21 and i<31)
cout<<" 歡迎光臨";
if(i>=31 and i<41)
cout<<" 歡迎光臨";
if(i>=41 and i<51)
cout<<" 歡迎光臨";
if(i>=51 and i<61)
cout<<" 歡迎光臨";
if(i>=61 and i<71)
cout<<" 歡迎光臨";
if(i>=71 and i<81)
cout<<" 歡迎光臨";
if(i>=81 and i<91)
cout<<" 歡迎光臨";
if(i>=91 and i<101)
cout<<" 歡迎光臨";
if(i>=101 and i<111)
cout<<" 歡迎光臨";
if(i>=111 and i<121)
cout<<" 歡迎光臨";
if(i>=121 and i<131)
cout<<" 歡迎光臨";
if(i>=131 and i<141)
cout<<" 歡迎光臨";
if(i>=141 and i<151)
cout<<"歡迎光臨";
system("cls");
}
goto allre;
system("pause");
return 0;
}
複製代碼
作者:
謝瀞儀
時間:
2015-6-14 17:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
allre:
for(int i=1;i<=290;i++)
{
if(i>=1 and i<11)
cout<<" ";
if(i>=11 and i<21)
cout<<" ◆";
if(i>=21 and i<31)
cout<<" ◇◆";
if(i>=31 and i<41)
cout<<" ◆◇◆";
if(i>=41 and i<51)
cout<<" ◇◆◇歡";
if(i>=51 and i<61)
cout<<" ◆◇◆歡迎";
if(i>=61 and i<71)
cout<<" ◇◆◇歡迎光";
if(i>=71 and i<81)
cout<<" ◆◇◆歡迎光臨";
if(i>=81 and i<91)
cout<<" ◇◆◇歡迎光臨◇";
if(i>=91 and i<101)
cout<<" ◆◇◆歡迎光臨◆◇";
if(i>=101 and i<111)
cout<<" ◇◆◇歡迎光臨◇◆◇";
if(i>=111 and i<121)
cout<<" ◆◇◆歡迎光臨◆◇◆";
if(i>=121 and i<131)
cout<<" ◇◆◇歡迎光臨◇◆◇";
if(i>=131 and i<141)
cout<<" ◆◇◆歡迎光臨◆◇◆";
if(i>=141 and i<151)
cout<<" ◇◆◇歡迎光臨◇◆◇";
if(i>=151 and i<161)
cout<<" ◆◇◆歡迎光臨◆◇◆";
if(i>=161 and i<171)
cout<<" ◇◆◇歡迎光臨◇◆◇";
if(i>=171 and i<181)
cout<<" ◆◇◆歡迎光臨◆◇◆";
if(i>=181 and i<191)
cout<<"◇◆◇歡迎光臨◇◆◇";
if(i>=191 and i<201)
cout<<"◇◆歡迎光臨◆◇◆";
if(i>=201 and i<211)
cout<<"◇歡迎光臨◇◆◇";
if(i>=211 and i<221)
cout<<"歡迎光臨◆◇◆";
if(i>=221 and i<231)
cout<<"迎光臨◇◆◇";
if(i>=231 and i<241)
cout<<"光臨◆◇◆";
if(i>=241 and i<251)
cout<<"臨◇◆◇";
if(i>=251 and i<261)
cout<<"◆◇◆";
if(i>=261 and i<271)
cout<<"◆◇";
if(i>=271 and i<281)
cout<<"◆";
if(i>=281 and i<291)
cout<<" ";
system("cls");
}
goto allre;
system("pause");
return 0;
}
複製代碼
作者:
李大全
時間:
2015-6-27 11:03
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
re:
for(int i=1; i<=80; i++)
{
if(i<=20)
cout<<"歡";
else if(i>21 && i<=40)
cout<<" 迎";
else if(i>41 && i<=60)
cout<<" 光";
else
cout<<" 臨";
system("cls");
}
for(int i=1; i<=80; i++)
{
if(i<=20)
cout<<"歡";
else if(i>21 && i<=40)
cout<<"歡迎";
else if(i>41 && i<=60)
cout<<"歡迎光";
else
cout<<"歡迎光臨";
system("cls");
}
for(int i=1; i<=140; i++)
{
if(i<=20)
cout<<"";
else if(i>21 && i<=40)
cout<<"歡迎光臨";
else if(i>41 && i<=60)
cout<<"";
else if(i>61 && i<=80)
cout<<"歡迎光臨";
else if(i>81 && i<=100)
cout<<"";
else if(i>101 && i<=120)
cout<<"歡迎光臨";
else
cout<<"";
system("cls");
}
goto re;
system("pause");
return 0;
}
作者:
洪振庭
時間:
2015-6-27 11:43
clude<iostream>
#include<cstdlib>
using namespace std;
int main()
{
re:
for(int i=1; i<=240; i+=2)
{
if(i<=120)
{
for(int j=0; j<=i; j++)
{
cout<<"";
}
}
else
{
for(int j=0; j<=240-i; j++)
{
cout<<"";
}
}
cout<<"歡迎光臨";
system("cls");
}
goto re;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2