Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Collections/C/collections-1.c
Normal file
11
Task/Collections/C/collections-1.c
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#define cSize( a ) ( sizeof(a)/sizeof(a[0]) ) /* a.size() */
|
||||
int ar[10]; /* Collection<Integer> ar = new ArrayList<Integer>(10); */
|
||||
ar[0] = 1; /* ar.set(0, 1); */
|
||||
ar[1] = 2;
|
||||
|
||||
int* p; /* Iterator<Integer> p; Integer pValue; */
|
||||
for (p=ar; /* for( p = ar.itereator(), pValue=p.next(); */
|
||||
p<(ar+cSize(ar)); /* p.hasNext(); */
|
||||
p++) { /* pValue=p.next() ) { */
|
||||
printf("%d\n",*p); /* System.out.println(pValue); */
|
||||
} /* } */
|
||||
12
Task/Collections/C/collections-2.c
Normal file
12
Task/Collections/C/collections-2.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
int* ar; /* Collection<Integer> ar; */
|
||||
int arSize;
|
||||
arSize = (rand() % 6) + 1;
|
||||
ar = calloc(arSize, sizeof(int) ); /* ar = new ArrayList<Integer>(arSize); */
|
||||
ar[0] = 1; /* ar.set(0, 1); */
|
||||
|
||||
int* p; /* Iterator<Integer> p; Integer pValue; */
|
||||
for (p=ar; /* p=ar.itereator(); for( pValue=p.next(); */
|
||||
p<(ar+arSize); /* p.hasNext(); */
|
||||
p++) { /* pValue=p.next() ) { */
|
||||
printf("%d\n",*p); /* System.out.println(pValue); */
|
||||
} /* } */
|
||||
Loading…
Add table
Add a link
Reference in a new issue