C?????ж??????????
???????????? ???????[ 2016/11/9 13:52:53 ] ????????C???? ????
????????????????????????????????????
1 #define _CRT_SECURE_NO_DEPRECATE
2 #include<stdio.h>
3 #include<stdlib.h>
4 void createOneDimensionalVector(){
5 int n?? i;
6 int *arr;
7 scanf("%d"??&n);
8 arr = (int*)malloc(sizeof(int)*n);
9 for (i = 0; i < n; i++)
10 arr[i] = i;
11 for (i = 0; i < n; i++)
12 printf("%d "??arr[i]);
13 }
14
15 int main(){
16 createOneDimensionalVector();
17
18 return 0;
19 }
??????????????????
1 void createTwoDimensionalVector(){
2 int n=3?? m=4;
3 int** a;
4 a = (int**)malloc(sizeof(int*)*n);//?????????????飬?????????????????a
5 for (int i = 0; i < n; i++)
6 a[i] = (int*)malloc(sizeof(int)*m);//????????????
7
8 for (int i = 0; i < n; i++){
9 for (int j = 0; j < m; j++)
10 a[i][j] = i + j;
11 }
12
13 for (int i = 0; i < n; i++){
14 for (int j = 0; j < m; j++)
15 printf("%d "??a[i][j]);
16 printf("
");
17 }
18 }
19 int main(){
20 createTwoDimensionalVector();
21
22 return 0;
23 }
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11