fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int N = 3;
  7. int A[N] = { 100, 200, 300 }; // A 是一個整數陣列 (array)。
  8. cout << A[0] << " " << A[1] << " " << A[2] << endl;
  9. // index 索引值
  10. for (int i = 0; i < N; i++) {
  11. cout << A[i] << " ";
  12. }
  13. cout << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
100 200 300
100 200 300