- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int turtle=0;
- cout << "有幾隻烏龜?(正常的烏龜)" <<endl;
- cin >> turtle;
- for(int i=1;i<=turtle;i++) //For迴圈的命名: i j k
- {
- cout << i << " 隻烏龜" << i << " 個頭和"<< i*4 << "隻腳"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |