本帖最後由 張翼安 於 2016-5-28 11:07 編輯
使文字訊息在畫面上反覆地左右移動.- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- re:
- int s=0;
- for(int i=1; i<=120; i++)
- {
- if(_________________)
- s++;
- else
- s--;
- for(_________________)
- cout<<" ";
- cout<<"歡迎光臨";
- _sleep(20);
- system("cls");
- }
- goto re;
- system("pause");
- return 0;
- }
複製代碼 |