📌  相关文章
📜  popualte 一个数组 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.716000             🧑  作者: Mango

代码示例1
const int arraysize = 10;
    int a[arraysize] = {1, 2, 3, 6, 8, 5, 5, 0, 2, 7};
    int b[arraysize] = {1, 2, 3};
    int c[arraysize] = {};


    for(int i = 0; i < arraysize; ++i) {
        std::cout << a[i] << ' ' << b[i] << ' ' << c[i] << std::endl;
    }

This outputs

1 1 0
2 2 0
3 3 0
6 0 0
8 0 0
5 0 0
5 0 0
0 0 0 
2 0 0 
7 0 0