格式:类型,数组名字[数组长度];
比如: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 |
24548 | dhxxlhw | Accepted | 1936 KB | 0 ms | C++ | 270 bytes | 2020-07-08 15:23:54 | |
24530 | dhxxlhw | H | Accepted | 1936 KB | 0 ms | C++ | 235 bytes | 2020-07-08 15:10:51 |
24480 | dhxxlhw | H | Wrong Answer | 1936 KB | 0 ms | C++ | 235 bytes | 2020-07-08 14:51:06 |
24479 | dhxxlhw | H | Compile Error | 0 KB | 0 ms | C | 235 bytes | 2020-07-08 14:50:50 |
24441 | dhxxlhw | G | Accepted | 1936 KB | 0 ms | C++ | 250 bytes | 2020-07-08 14:40:27 |
24436 | dhxxlhw | C | Accepted | 1544 KB | 0 ms | C++ | 302 bytes | 2020-07-08 14:37:38 |
24369 | dhxxlhw | E | Accepted | 1544 KB | 0 ms | C++ | 330 bytes | 2020-07-08 14:19:41 |
24342 | dhxxlhw | G | Wrong Answer | 1936 KB | 0 ms | C++ | 232 bytes | 2020-07-08 14:09:42 |
24329 | dhxxlhw | Accepted | 1936 KB | 0 ms | C++ | 277 bytes | 2020-07-08 14:05:03 | |
24325 | dhxxlhw | D | Accepted | 1544 KB | 0 ms | C++ | 270 bytes | 2020-07-08 14:04:01 |
24220 | dhxxlhw | C | Presentation Error | 1584 KB | 0 ms | C++ | 309 bytes | 2020-07-08 13:20:46 |
24214 | dhxxlhw | B | Accepted | 1584 KB | 0 ms | C++ | 228 bytes | 2020-07-08 13:17:34 |
24209 | dhxxlhw | B | Runtime Error | 1544 KB | 0 ms | C++ | 220 bytes | 2020-07-08 13:16:13 |
24205 | dhxxlhw | A | Accepted | 1936 KB | 0 ms | C++ | 184 bytes | 2020-07-08 13:15:45 |