Show Menu
Cheatography

C++ matrici Cheat Sheet by [deleted]

CITIREA

cout<<­"­Int­rod­uceti numarul de linii";
cin>>n;
cout<<­"­Int­rod­uceti numarul de coloan­e";
cin>>m;
for(i=1; i<=n; i++)
for(j=1; j<=m; j++)
{cout<­<"a[­"­<<i­<<"]­["<<­j<<­"­]=";
cin<<a­[i][j];
Daca n=m matricea se va numi PATRATICA.
 

DECLARAREA

numele­_ma­tri­cei[nr. de linii][nr. de coloane];
ex. a[10][10];

AFISAREA

for(i=1; i<=n; i++)
{for(j=1; j<=m; j++)
cout<­­<a[­i][­j];­<<" ";
cout<<­endl;
}
 

MATRICI PATRATICE

DIAGONALA PRINCI­PALA:
DIAGONALA SECUNDARA
pe ea: i=j
pe ea: i+j=n+1
sub ea: i>j
sub ea: i+j>n+1
deasupra de ea: i<j
deasupra de ea: i+j<n+1

ZONELE MATRICELOR PATRATICE

ZONA DE NORD
ZONA DE SUD
ZONA DE EST
ZONA DE VEST
i<j && i+j<n+1
i>j && i+j>n+1
i<j && i+j>n+1
i>j && i+j<n+1
       
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Numeric Formats Cheat Sheet

          More Cheat Sheets by [deleted]