Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Structuri de date. Culegere de probleme în C++

# Structuri de date. Culegere de probleme în C++

Ratings: (0)|Views: 6,348 |Likes:

### Availability:

See more
See less

07/31/2013

pdf

text

original

Cuprins
1. Vectori\u015fi matrice.................................................................................................
3
2. Articole...................................................................................................................
18
3. Pointeri....................................................................................................................
29
4. Func\u0163ii......................................................................................................................
62
5. Liste.........................................................................................................................

69 6. Stive........................................................................................................................ 104 7. Arbori......................................................................................................................

117
8. Fi\u015fiere.....................................................................................................................

131 9. Obiecte................................................................................................................... 137 10. Volumul de prelucr\u0103ri......................................................................................... 147 11. Agregarea structurilor de date....................................................................... 152

Structuri de date \u2013 Culegere de probleme \u00een C++
9HFWRUL\ue000\u00faL\ue000PDWULFH
1. Vectori
Problema 1.1.\ue000\ue000\ue0006\ue000VH\ue000vQVXPH]H\ue000HOHPHQWHOH\ue000D\ue000WUHL\ue000YHFWRUL\ue004\ue000ILHFDUH a c\u00e2te
n elemente, definite intr-R\ue000]RQ \ue000GH\ue000PHPRULH\ue000FRQWLJX \ue005\ue000
Rezolvare:

#include<stdio.h>
#include<conio.h>
typedef int vect[10];
const vect x={ 1,2,3,4,5,6,7,8,9,10 };
const vect y={ 10,9,8,7,6,5,4,3,2,1 };
const vect z={ 1,1,2,2,3,3,4,4,5,5 };
int s=0;
void main(){

clrscr();
for(inti=0;i<30;i++) s+=x[i];
printf("\nSuma este: %d ",s);
getch();
}Problema 1.2.\ue000 \ue000 6H\ue000 FRQVLGHU\ue000 XQ\ue000 YHFWRU\ue000 GH\ue000 PD[LP\ue000 \ue008\ue006\ue000 HOHPHQWH\ue000 GH\ue000 WLS\ue000

vQWUHJ\ue005 1XP UXO\ue000GH\ue000HOHPHQWH\ue000\u00faL\ue000YDORULOH\ue000ORU\ue000VH\ue000FLWHVF\ue000GH\ue000OD\ue000WHUPLQDO\ue005\ue0006 \ue000VH\ue000 RUGRQH]H\ue000 FUHVF WRU\ue000 HOHPHQWHOH\ue000 YHFWRUXOXL\ue000 \u00faL\ue000 V \ue000 VH\ue000 VFULH\ue000 IXQF LD\ue000 GH\ue000 vQVHUDUH\ue000D\ue000XQXL\ue000HOHPHQW\ue000vQ\ue000YHFWRU\ue000DVWIHO\ue000vQFkW\ue000GXS \ue000RSHUD LD\ue000GH\ue000vQVHUDUH\ue004\ue000 YHFWRUXO\ue000V \ue000U PkQ \ue000RUGRQDW\ue005\ue000\ue000\ue000\ue000\ue000

Rezolvare:

#include<stdio.h>
#include<conio.h>
typedef int vector[20];
vector a;
int n;

3