標題:
for 迴圈 (一)
[打印本頁]
作者:
鄭又綸
時間:
昨天 16:29
標題:
for 迴圈 (一)
利用for迴圈,在畫面上直向顯示1~10。
C++_Repetition Structure
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
//初始值; 持續的條件; 變化方式
for(int i=1; i<=10; i++)
{
cout<<i<<endl;
}
system("pause");
return 0;
}
複製代碼
[attach]21003[/attach]
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://www.istak.org.tw/seed/)
Powered by Discuz! 7.2