格式:类型,数组名字[数组长度];
比如:int a[10]; 表示定义了一个长度为10的数组,数组名为a,其中数组下标从0开始,即a[0], a[1], a[2]...a[9];
输入这10个数,可以使用for循环实现
for(int i=0; i<10; i++) cin>>a[i];
也可以对其中的某个值赋值,比如a[0] = 1,a[5] = 3;
整个数组的输出,也可以for循环实现。
可以把一维数组理解成,一维的表格。
RunID | User | Problem ID | Result | Memory | Time | Language | Code Length | Submit Time |
45702 | chenxuanlin | Accepted | 1544 KB | 0 ms | C++ | 256 bytes | 2021-02-23 12:21:20 | |
45701 | chenxuanlin | H | Accepted | 1544 KB | 0 ms | C++ | 284 bytes | 2021-02-23 12:12:08 |
45700 | chenxuanlin | G | Accepted | 1544 KB | 0 ms | C++ | 275 bytes | 2021-02-23 12:04:31 |
45699 | chenxuanlin | Accepted | 1544 KB | 0 ms | C++ | 302 bytes | 2021-02-23 11:59:22 | |
45698 | chenxuanlin | E | Accepted | 1544 KB | 0 ms | C++ | 313 bytes | 2021-02-23 11:58:56 |
45697 | chenxuanlin | D | Accepted | 1544 KB | 0 ms | C++ | 248 bytes | 2021-02-23 11:57:09 |
45696 | chenxuanlin | C | Accepted | 1544 KB | 0 ms | C++ | 306 bytes | 2021-02-23 11:51:21 |
45695 | chenxuanlin | C | Wrong Answer | 1544 KB | 0 ms | C++ | 295 bytes | 2021-02-23 11:46:36 |
45694 | chenxuanlin | C | Wrong Answer | 1544 KB | 0 ms | C++ | 269 bytes | 2021-02-23 11:44:38 |
45693 | chenxuanlin | B | Accepted | 1548 KB | 0 ms | C++ | 236 bytes | 2021-02-23 11:40:46 |
45692 | chenxuanlin | A | Accepted | 1544 KB | 0 ms | C++ | 189 bytes | 2021-02-23 11:34:15 |