本帖最後由 李泳霖 於 2021-10-28 16:42 編輯
利用巢狀迴圈, 完成如下之畫面:
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- for(______________)
- {
- cout<<i<<"隻青蛙"<<i<<"張嘴, "<<i*2<<"個眼睛"<<i*4<<"條腿, ";
- for(______________)
- {
- cout<<"撲通~";
- }
- cout<<"跳下水!"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- for(______________)
- {
- if(i==1)
- cout<<i<<"Frog,"<<i<<"mouth, "<<i*2<<"eyes"<<i*4<<"legs, ";
- else
- cout<<i<<"Frogs,"<<i<<"mouths, "<<i*2<<"eyes"<<i*4<<"legs, ";
- for(______________)
- {
- cout<<"thump~";;
- }
- cout<<"Jump into the water!"<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼本帖隱藏的內容需要回復才可以瀏覽
本帖隱藏的內容需要回復才可以瀏覽 |