home | login | register | DMCA | contacts | help | donate |      

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
А Б В Г Д Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Э Ю Я


my bookshelf | genres | recommend | rating of books | rating of authors | reviews | new | форум | collections | читалки | авторам | add
fantasy
space fantasy
fantasy is horrors
heroic
prose
  military
  child
  russian
detective
  action
  child
  ironical
  historical
  political
western
adventure
adventure (child)
child's stories
love
religion
antique
Scientific literature
biography
business
home pets
animals
art
history
computers
linguistics
mathematics
religion
home_garden
sport
technique
publicism
philosophy
chemistry
close

Loading...


Example

int A1[] = { 1, 2, 3, 4, 5, 6, 7 };

int A2[] = { 1, 4, 7 };

int A3[] = { 2, 7, 9 };

int A4[] = { 1, 1, 2, 3, 5, 8, 13, 21 };

int A5[] = { 1, 2, 13, 13 };

int A6[] = { 1, 1, 3, 21 };

const int N1 = sizeof(A1) / sizeof(int);

const int N2 = sizeof(A2) / sizeof(int);

const int N3 = sizeof(A3) / sizeof(int);

const int N4 = sizeof(A4) / sizeof(int);

const int N5 = sizeof(A5) / sizeof(int);

const int N6 = sizeof(A6) / sizeof(int);

cout << "A2 contained in A1: " << (includes(A1, A1 + N1, A2, A2 + N2) ? "true" : "false") << endl;

cout << "A3 contained in A1: " << (includes(A1, A1 + N2, A3, A3 + N3) ? "true" : "false") << endl;

cout << "A5 contained in A4: " << (includes(A4, A4 + N4, A5, A5 + N5) ? "true" : "false") << endl;

cout << "A6 contained in A4: " << (includes(A4, A4 + N4, A6, A6 + N6) ? "true" : "false") << endl;

The output is:

A2 contained in A1: true

A3 contained in A1: false

A5 contained in A4: false

A6 contained in A4: true


Complexity | Standard Template Library Programmer`s Guide | Notes







Loading...