Sie sind auf Seite 1von 4

Es el ultimo que dejo

#include<iostream>

#include<conio.h>

#include<string.h>

#include<cstring>

using namespace std;

main()

char box[10][10]= {

'Q','W','E','R','T','Y','Y','U','I','O',

'A','S','D','F','G','R','H','J','A','P',

'Z','R','S','X','R','P','C','V','B','N',

'W','Q','A','E','G','I','M','J','Y','M',

'E','R','M','G','T','P','Y','U','U','I',

'A','S','W','D','O','I','F','P','H','P',

'K','L','I','Z','X','N','C','I','V','B',

'N','M','S','Q','W','E','R','T','T','Y',

'U','I','E','O','P','A','S','E','D','F',

'F','L','A','D','N','A','G','R','G','H',

};

for(int i=0;i<10;i++)

for(int j=0;j<10;j++)

{
if (box[i-1][j]== 'V' && box[i+1][j]== 'U' )

{ cout<<box[i][j];

else if(box[i][j]== 'U' && box[i][j+1]== 'U' )

{ cout<<box[i][j]; }

else if(box[i][j]== 'P' && box[i][j+1]== 'H' )

{ cout<<box[i][j]; }

else if(box[i][j]== 'I' && box[i][j+1]== 'V' )

{ cout<<box[i][j]; }

else if(box[i][j]== 'T' && box[i][j+1]== 'T' )

{ cout<<box[i][j]; }

else if(box[i][j]== 'E' && box[i][j+1]== 'D' )

{ cout<<box[i][j]; }

else if(box[i][j]== 'R' && box[i][j+1]== 'G' )

{ cout<<box[i][j]; }

else {cout<<"+";}

cout<<endl;

getch();

}// Lee un solo carácter directamente desde el teclado, sin mostrar tal carácter en pantalla.

Suma de arreglos

#include <iostream>

using namespace std;

int main()

{
int x[4][2] = {{40,50},{25,35},{23,45},{50,32}};

int suma,i,j,suma2;

suma = 0;

suma2 = 0;

for (i = 0; i < 4; i++)

for (j = 0; j < 1; j++)

cout<<"Elemento en pos["<<i<<"]["<<j<<"]:";

cout<<x[i][j]<<endl;

suma = suma + x[i][j];

cout<<"Su suma es "<<suma<<endl;

cout<<"\n";

for (i = 0; i < 4; i++)

for (j = 1; j < 2; j++)

cout<<"Elemento en pos["<<i<<"]["<<j<<"]:";

cout<<x[i][j]<<endl;

suma2 = suma2 + x[i][j];

cout<<"Su suma es "<<suma2<<endl;

return 0;

}
calcule la potencia al cubo del siguiente arreglo:

int x[3][2] = {{2,4}, {6,12}, {4,5}};

#include <iostream>

#include <math.h>

using namespace std;

int main(){

int x[3][2] ={{2*2*2,4*4*4},{6*6*6,12*12*12},{4*4*4,5*5*5}};

for(int i=0; i<3; i++){

for(int j=0; j<2;j++){

cout << "Elemento en Post["<< i<< "][" <<j <<"]:" ;

cout << x[i][j]<< endl;

return 0;

Das könnte Ihnen auch gefallen