返回列表 發帖

for 迴圈

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.   int x;
  7.   for (x=1;x<=6;x++)
  8.   {
  9.     cout<<"第"<<x<<"名"<<endl;  
  10.   }
  11.    
  12.   system("pause");
  13.   return 0;
  14. }
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     for (x=1;x<=6;x++)
  8.     {
  9.         cout<<"第"<<x<<"名"<<endl;
  10.     }
  11.          
  12.     system("pause");   
  13.    return 0;
  14. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. for(int x=1;x<=10;x++)
  7. {
  8.         cout<<"第"<<x<<"名"<<endl;
  9. }
  10. system("pause");
  11. return 0;
  12. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. int x;
  7. for(x=1;x<=6;x++)
  8. {
  9. cout<<"第"<<x<<"名"<<endl;
  10. }
  11.     system("pause");
  12.     return 0;
  13. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     for(x=1;x<=6;x++)
  8.     {
  9.         cout<<"第"<<x<<"名"<<endl;            
  10.         }         
  11.    
  12.    system("pause");
  13.     return 0;     
  14. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     int m;
  7.     for(m=1;m<=6;m++)
  8.     {
  9.                   cout<<"第"<<m<<"名"<<endl;
  10.                   }   
  11.     system("pause");
  12.     return 0;
  13. }   
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. int x;
  7. for(x=1;x<=6;x++)
  8. {cout<<"第"<<x<<"名"<<endl;}
  9.      system("pause");
  10. return 0;
  11. }
複製代碼

TOP

返回列表