new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
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); */
|
||||
} /* } */
|
||||
11
Task/Collections/C/collections.c
Normal file
11
Task/Collections/C/collections.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); */
|
||||
} /* } */
|
||||
Loading…
Add table
Add a link
Reference in a new issue