Вы находитесь на странице: 1из 4

1.

DESARROLLAR UNA SOLUCION QUE PERMITA INGRESAR Y ALMACENAR EL PRECIO DE


COMPRA Y EL PRECIO DE VENTA DE TODOS LOS ARTICULOS DE UNA BODEGA(PRECIOS)
include<iostream>
#include<windows.h>
#include<conio.h>

using namespace std;

main ()
{

int mat[4][5];
int numv,nump;
int acump;
int acumt=0;
int mattotal[4][5];
int cod[15];
int i, j;
int c;
int vn[4];
int vp[5];

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

acumt=0;

cout<<"Vendedor # "<<i+1<<endl;
do
{

for(j=0;j<5;j++)
{

cout<<"Producto # "<<j+1<<endl;
cout<<"Ingrese el codigo del producto "<<endl;
cin>>cod[i];

c++;

cout<<"Producto # "<<j+1<<endl;
cout<<"Ingrese el monto total vendido "<<"Del producto
"<<cod[i]<<endl;
cin>>mat[i][j];
acumt+=mat[i][j];

cout<<"El vendedor # "<<i+1<<" Vendio un total de "<<acumt<<endl;

}while(c<5);

cout<<"Matriz que muestra lo cuanto de cada producto vendieron

"<<endl;

for(i=0;i<4;i++)
{
cout<<endl;

for(j=0;j<5;j++)
{
cout<<" "<<mat[i][j];
}
}

cout<<endl<<"Matriz muestra total de cuanto vendieron los vendedores


"<<endl;

for(i=0;i<4;i++)
{
vn[i]=0;
for(j=0;j<5;j++)
{
vn[i]=vn[i]+mat[i][j];

cout<<"El vendedor # "<<i+1<<" Vendio "<<vn[i]<<endl;


}

cout<<endl<<"Matriz muestra total de cuanto se vendio de Cada Producto


"<<endl;

for(j=0;j<5;j++)
{
vp[j]=0;
for(i=0;i<4;i++)
{
vp[j]=vp[j]+mat[i][j];

cout<<"Producto # "<<j+1<<" "<<" se vendieron "<<vp[j]<<" Cantidades


"<<endl;
}

return 0;
}

2.DESARROLLAR UNA SOLUCION QUE PERMITA INGRESAR Y ALMACENAR EL


CODIGO Y EL NOMBRE DE LOS EMPLEADOS DE UNA COMPAA

#include<stdio.h>
#include<stdlib.h>
struct empleado{
char nombre[100];
char sexo[20];
int sueldo;
};
main(){
int N;

printf("Ingrese la cantidad de empleados de DATASYSTEM: ");


scanf("%d",&N);
struct empleado E[N];
int i;
for(i=0;i<N;i++){
printf("Ingrese los datos del empleado %d\n",(i+1));
printf("Nombre: ");
gets(E[i].nombre);
printf("\n");
printf("Sexo: ");
gets(E[i].sexo);
printf("Sueldo: ");
scanf("%d",&E[i].sueldo);
printf("\n\n");
}
}

Вам также может понравиться