本帖最後由 駱顗安 於 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;
- }
複製代碼 |