Buscar este blog

domingo, 27 de mayo de 2012

Ordena 10 nombres alfabeticamente

Problema 2
GARCIA GAETA FRANCISCO ARMANDO NO.CONTROL: 11211033
Haga un programa que almacenen 10 nombres de alumnos en un arreglo de caracteres
[10][25] y los ordene alfabeticamente. El usuario debe introducir la cantidad de
alumnos a insertar
pseudocodigo:
1.       Inicio.

void insertarDatos(char Nombres[10][25], int N) 
void Reordenar(char Nombres[10][25], int N) 

int main()
{ char Nom[10][25] 
int N 
Print "Igresasr la cantidad de alumnos: " 
Read N 
insertarDatos(Nom, N) 
Reordenar(Nom, N) 
Fin main   }

void insertarDatos(char Nombres[10][25], int N)
{ int I 
for(I=0    I<N    I++)
{Print "Nombre Alumno "<<(I+1)<<": " 
gets(Nombres[I])  }}

void Reordenar(char Nombres[10][25], int N)
{ int I, J 
char temp[25] 
for(I=0    I<(N-1)    I++)
{ for(J=I+1    J<N    J++)
{ if( strcmp(Nombres[I], Nombres[J])>0)
{strcpy(temp, Nombres[I]) 
strcpy(Nombres[I], Nombres[J]) 
strcpy(Nombres[J], temp)  }}}
for(I=0    I<N    I++)
{Print endl<<Nombres[I]  }}






Problema 4
GARCIA GAETA FRANCISCO ARMANDO NO.CONTROL: 11211033
Haga un programa que escriba en un archivo llamado nombres.txt que genere un
archivo texto para almacenar los nombres de n alumnos y un archivo de
calificaciones.txt para almacenar 6 calificaciones de cada estudiante. Debe
calcular el promedio de cada estudiante.   
pseudocodigo:
1.       Inicio.

void salida_datos_file(int n)
{
ofstream salida    
salida.open("E://datos//nombres//nombres.txt")    
int i    
char name[30]    
for( i=1       i<=n       i++)
{
Print "Nombre " , i  , ":"    
gets(name)    
salida , name ,    
}salida.close()     }

void entrada_datos_file()
{
ifstream entrada    
entrada.open("E://datos//nombres//nombres.txt")    
char name[30]    
Print "\nListado de nombres\n"    
entrada.getline(name, 30)    
Print name ,    
while(!entrada.eof())
{
entrada.getline(name, 30)    
Print name ,    
}
entrada.close()    
}

void almacena_calif(int n)
{
ofstream salida    
salida.open("E://datos//nombres//calificaciones.txt")    
int r, c, calif    
for(r=0       r<n       r++)
{
Print "Introdusca las calificaciones del estudiante " , (r+1) , ":" ,    
for(c=0       c<6       c++)
{
Print "calificaciones " , (c+1) , "= "    
Read  calif    
salida , calif , " "    
} salida ,    }}

void leer_archivo_calif(int a[20][6], int promedio[20], int n)
{ ifstream entrada    
Print "\n" ,    
entrada.open("E://datos//nombres//calificaciones.txt")    
int r, c, suma     
for(r=0       r<n       r++)
{
suma=0    
for(c=0       c<6       c++)
{
entrada>>a[r][c]    
Print a[r][c] , "\t"    
suma=suma + a[r][c]    
}
promedio[r]=suma/6    
Print "Proemdio: " , promedio[r] ,    
}}

void main()
{
int n    
int c[20][6], p[20]    
Print "no de estudiantes ="    
Read  n    
salida_datos_file(n)    
entrada_datos_file()    
almacena_calif(n)    
leer_archivo_calif(c, p, n)    
Fin main    
}



Problema 5A
GRCIA GAETA FRANCSICO ARMADNO NO.CONTROL: 11211033
Introducir en un archivo de texto una lista de nombres y obtener un reporte del
contenido del archivo, el usuario debe introducir la palabra fin, para detener
el proceso de almacenamiento de nombres.   
Pseudocodigo:
1.       Inicio.
void salida_datos_file()
{
ofstream salida    
salida.open("E://datos//nombres//nombres5.txt")    
char name[30]    
do{
Print "Nombre :"    
gets(name)    
salida , name ,    }
while(strcmp(name, "fin")!=0)    
salida.close()     }

void entrada_datos_file()
{
ifstream entrada    
entrada.open("E://datos//nombres//nombres5.txt")    
char name[30]    
Print "\nReporte del archivo.\n"    
entrada.getline(name, 30)    
Print name ,    
do{ entrada.getline(name, 30)    
Print name ,    
}while(!entrada.eof())    
entrada.close()     }

int main()
{
Print "ingresar lista de nombres para detener el proceso escribir la palabra fin" ,    
salida_datos_file()    
entrada_datos_file()    
Fin main    
}





































Problema 5B

GRCIA GAETA FRANCSICO ARMADNO NO.CONTROL: 11211033
agregar datos al archivo de nombres e imprimir el contenido del archivo   
Pseudocodigo:
1.       Inicio.

void salida_datos_file()
{
ofstream salida 
salida.open("E://datos//nombres//nombres5.txt",ios::app) 
char name[30] 
do{
Print "Nombre :" 
Read (name) 
salida ,  name ,    }
while(strcmp(name, "fin")!=0) 
salida.close()  }

void entrada_datos_file()
{
ifstream entrada 
entrada.open("E://datos//nombres//nombres5.txt") 
char name[30] 
Print "\nReporte del archivo.\n" 
entrada.getline(name, 30) 
Print name ,    
do{ entrada.getline(name, 30) 
Print name ,    
}while(!entrada.eof()) 
entrada.close()  }

int main()
{
Print "ingresar lista de nombres para detener el proceso escribir la palabra fin" ,    
salida_datos_file() 
entrada_datos_file() 
Fin main 
}






Problema 6A
GARCIA GAETA FRANCISCO ARMANDO NO.CONTROL: 11211033
Escriba un programa que acepte n lineas de texto desde el teclado y almacenar
cada linea de texto en un archivo llamado texto.dat hasta que el usuario
introduca la palabra fin. Leer y mostrar los archivos guardados en el archivo
texto.dat.      */
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
#include<string.h>

void salida_datos_file()
{
ofstream salida_texto 
salida_texto.open("E://datos//nombres//texto.dat") 
char linea[60] 
do{ Read (linea) 
salida_texto ,  linea ,    }
while(strcmp(linea, "fin")!=0) 
salida_texto.close()  }

void entrada_datos_file()
{
ifstream entrada_texto 
entrada_texto.open("E://datos//nombres//texto.dat") 
char linea[60] 
Print "\nDatos del archivo.\n" 
entrada_texto.getline(linea, 60) 
Print linea ,    
do{ entrada_texto.getline(linea, 60) 
Print linea ,    
}while(!entrada_texto.eof()) 
entrada_texto.close()  }

int main()
{
Print "ingresar lineas de texto, para detener el proceso escribir la palabra fin" ,    
salida_datos_file() 
entrada_datos_file() 
Fin main 
}




Problema 6B
GARCIA GAETA FRANCISCO ARMANDO NO.CONTROL: 11211033
Escriba un programa en c++ que acepte lineas de texto desde el teclado y escriba
cada linea a un archivo texto llamado texto.dat hasta que introdusca una linea
vacia. Leer y mostrar los datos almacenados en el archivo texto.dat.       */
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
#include<string.h>

void salida_datos_file()
{
ofstream salida_texto 
salida_texto.open("E://datos//nombres//texto.dat") 
char linea[60] 
do{ Read (linea) 
salida_texto ,  linea ,    }
while(strcmp(linea, "\n")>=0) 
salida_texto.close()  }

void entrada_datos_file()
{
ifstream entrada_texto 
entrada_texto.open("E://datos//nombres//texto.dat") 
char linea[60] 
Print "\nDatos del archivo.\n" 
entrada_texto.getline(linea, 60) 
Print linea ,    
do{ entrada_texto.getline(linea, 60) 
Print linea ,    
}while(!entrada_texto.eof()) 
entrada_texto.close()  }

int main()
{
Print "ingresar lineas de texto, para detener el proceso deje una liena en blanco\n" ,    
salida_datos_file() 
entrada_datos_file() 
Fin main 
}














Problema 7A
GARCIA GAETA FRANCISCO ARMANDO NO.CONTROL: 11211033
ESCRIBA UN PROGRAMA QUE PUEDA CREAR UN ARCHIVO DE TEXTO LLAMADO VOLTIOS Y ESCRIBA
EN EL LOS SIGUIENTES REGISTROS:
120.3        122.7        90.3        99.8
95.3         120.5        127.3       129.8
123.2        118.4        123.8       115.6
122.4        95.6         118.2       120.99
123.5        130.2        123.98      124.4
CON BASE EN LOS DATOS DEL ARCHIVO VOLTIOS LEER CADA REGISTRO EN EL ARCHIVO Y CALCULAR
EL PROMEDIO PARA CADA REGISTRO.      
Pseudocodigo:
1.       Inicio.

void salida_datos_file()
{
ofstream salida 
salida.open("E://datos//nombres//voltios.txt") 
salida ,  120.3 ,  " " ,  122.7 ,  " " ,  90.3 ,  " " ,  99.8 ,    
salida ,  95.3 ,  " " ,  120.5 ,  " " ,  127.3 ,  " " ,  129.8 ,    
salida ,  123.2 ,  " " ,  118.4 ,  " " ,  123.8 ,  " " ,  115.6 ,    
salida ,  122.4 ,  " " ,  95.6 ,  " " ,  118.2 ,  " " ,  120.99 ,    
salida ,  123.5 ,  " " ,  130.2 ,  " " ,  123.98 ,  " " ,  124.4 ,    
salida.close()  }

void archivo(real   valor[5][4])
{ int I, J 
ifstream entrada 
entrada.open("E://datos//nombres//voltios.txt") 
for(I=0    I<5    I++)
{for(J=0    J<4    J++)
{entrada>>valor[I][J] 
Print valor[I][J] ,  "\t"  }}}

void entrada_datos_file()
{ int I, J 
ifstream entrada 
entrada.open("E://datos//nombres//voltios.txt") 
real   suma, valor, prom[5] 
Print "\nPromedios de los registros.\n" 
for(I=1    I<=5    I++)
{ suma=0 
for(J=1    J<=4    J++)
{ entrada>>valor 
suma=suma+valor 
prom[I]=suma/4  }
Print "Promedio " ,  (I) ,  ": " ,  prom[I] ,    }
entrada.close()  }

int main()
{real   v[5][4] 
Print "Archivo voltios\n" ,    
salida_datos_file() 
archivo(v) 
entrada_datos_file() 
Fin main 
}




Problema 7B
GARCIA GAETA FRANCISCO ARMANDO NO.CONTROL: 11211033
Agregar los siguientes tres registros al archivo voltios:
EN EL LOS SIGUIENTES REGISTROS:
122.11      128.5      99.2      89.70
125.12      101.33     89.75     129.90
95.33       124.50     133.23    95.34
leer cada registro y calcular el promedio de cada registro y el promedio general
de los voltios.                                
pseudocodigo:
1 inicio.
void salida_datos_file()
{
ofstream salida 
salida.open("E://datos//nombres//voltios.txt",ios::app) 
salida ,  122.11 ,  " " ,  128.5 ,  " " ,  99.2 ,  " " ,  89.70 ,    
salida ,  125.12 ,  " " ,  101.33 ,  " " ,  89.75 ,  " " ,  129.90 ,    
salida ,  95.33 ,  " " ,  124.50 ,  " " ,  133.23 ,  " " ,  95.34 ,    
salida.close()  }

void archivo(real   valor[8][4])
{ int I, J 
ifstream entrada 
entrada.open("E://datos//nombres//voltios.txt") 
for(I=0    I<8    I++)
{for(J=0    J<4    J++)
{entrada>>valor[I][J] 
Print valor[I][J] ,  "\t"  }}}

void entrada_datos_file()
{ int I, J 
ifstream entrada 
entrada.open("E://datos//nombres//voltios.txt") 
real   suma, valor, prom[8], pv=0 
Print "\nPromedios de los registros.\n" 
for(I=1    I<=8    I++)
{ suma=0 
for(J=1    J<=4    J++)
{ entrada>>valor 
suma=suma+valor 
prom[I]=suma/4  }
Print "Promedio " ,  (I) ,  ": " ,  prom[I] ,    
pv=pv+prom[I]/8  }
Print "Proemdio de los voltios: " ,  pv ,    
entrada.close()  }

int main()
{real   v[8][4] 
Print "Archivo voltios\n" ,    
salida_datos_file() 
archivo(v)  
entrada_datos_file() 
Fin main 
}



sábado, 19 de mayo de 2012

PRACTICA 14


PROBLEMA 1
GARCIA GAETA FRNACISCO ARMANDO NO. CONTROL: 11211033
ESCROBIR UN PROGRAMA INTERACTIVO PARA PROCESAR LAS NOTAS DE UN GRUPO DE
ESTUDIANTES DE UN CURSO DE PROGRAMACION ENPEZA ESPECIFICANDO EL NUMERO DE NOTAS
DE EXAMEN PARA CADA ESTUDIANTE. DESPUES INTRODUCIR EL NOMBRE DE CADA ESTUDIANTE
Y LAS NOTAS DE LOS EXAMENES. CALCULAR UNA MEDIA PARA CADA ESTUDIANTE Y UNA MEDIA
GENERAL DE LA CLASE. IMPRIMIR EL NOMBRE DEL ESTUDIANTE LAS NOTAS INDIVIDUALES
DE LOS EXAMENES Y LA MEDIA PARA CADA ESTUDIANTE Y AL FINAL LA MEDIA DE LA CLASE.
Pseudocodigo:
1.       Inicio
template <class T>
void IntroducirDatos(T Arreglo[20][5], int N, int M, char Name[20][30]) 
template <class T>
void CalcularPromedio(T Arreglo[20][5], int N, int M, char Name[20][30], real    promedioG[20]) 
void DesplegarDatos(int Areglo[20][5], int N, int M, char Name[20][30], real    promedioG[20]) 
void MayorPromedio(int N, char Name[20][30], real    promedioG[20]) 

void main()
{int Arreglo[20][5] 
int  N,  M 
char Name[20][30] 
real    pG[20] 
Print   , "Ingresar el numero de alumnos del grupo:" 
Read N 
Print   , "Ingresar el numero de calificaciones por alumno:" 
Read M 
Print   , "\n" ,  
IntroducirDatos(Arreglo,  N,  M,  Name) 
Print   , "\n" ,  
CalcularPromedio(Arreglo,  N,  M,  Name, pG) 
Print   , "\n" ,  
DesplegarDatos(Arreglo, N, M, Name, pG) 
Print   , "\n" ,  
MayorPromedio(N, Name, pG) 
Fin main

template <class T>
void IntroducirDatos(T Arreglo[20][5], int N, int M, char Name[20][30])
{ int R, C 
Print   , "Introducir Datos" ,  
for(R=0    R<N    R++)
{ Print   , "Nombre Alumno" , (R+1) , ":" 
Read  (Name[R]) 
for(C=0    C<M    C++)
{ Print   , "Calificacion" , (C+1) , "=" 
Read Arreglo[R][C]  }}}

template <class T>
void CalcularPromedio(T Arreglo[20][5], int N, int M, char Name[20][30], real    promedioG[20])
{ int R, C 
real    suma=0 
for(R=0    R<N    R++)
{ suma=0 
Name[R] 
for(C=0    C<M    C++)
{suma=suma+Arreglo[R][C]  }
promedioG[R]=suma/M  }
}


void DesplegarDatos(int Arreglo[20][5], int N, int M, char Name[20][30], real    promedioG[20])
{ int R, C 
Print   , " Nombre          " 
for(C=0    C<M    C++){Print   , "      C" , (C+1) , "  "  }
Print   , "  Media estudiante" ,  
for(R=0    R<N    R++){
Print   , " " , Name[R] , setw(8) 
for(C=0    C<M    C++){Print   , setw(2) , Arreglo[R][C] , setw(6)  }
Print   , setw(18) , promedioG[R] ,  }}

void MayorPromedio(int N, char Name[20][30], real    promedioG[20])
{ int R, mayor 
real    mayorp=0, pc=0 
for(R=0    R<N    R++)
{ pc=pc+promedioG[R]/N 
if(promedioG[R]>mayorp)
{mayorp=promedioG[R] 
mayor=R  }}
Print   , "La media de clase fue : " , pc ,  
Print   , "El mayor promedio lo obtubo: " , Name[mayor] ,  
Print   , "Su promedio fue: " , mayorp ,  }



Problema 2
FRANCISCO ARMANDO GARCIA GAETA NO.CONTROL: 11211033
HAGA UN PROGRAMA QUE CONSIDERE UN ARREGLO BIDIMENSIONAL CUADRDO DE 4X4 DE NUMEROS
ENTEROS. REALIZAR LAS SIGUIENTES FUNCIONES:
A) GENERAR NUMEROS ALEATORIOS PARA ELL ARREGLO BIDIMENCIONAL DE 4X4.
B) UNA FUNCION PARA SUMAR LAS COLLUMNAS Y DESPLEGAR CADA SUMA.
C) UNA FUNCION PARA SUMAS LOS RENGLONES Y DESPLEGAR CADA SUMA.
D) UNA FUNCION PARA SUMAR LA DIAGONAL PRINCIPAL.
E) UNA FUNCION PARA SUMAR LA DIAGONAL INVERSA.
F) UNA FUNCION PARA DESPLEGAR TODO EL ARREGLO BIDIMENCIONAL. 

Pseudocodigo:
1.       Inicio.
int IntroducirDatos(int Arreglo[4][4]) 
void Sumacolumnas(int Arreglo[4][4]) 
void SumaRenglones(int Arreglo[4][4]) 
void DesplegarArreglo(int Arreglo[4][4]) 
void SumaDiagonar(int Arreglo[4][4]) 
void SumaDiagonalInv(int Arreglo[4][4]) 

int main()
{int Arreglo[4][4] 
IntroducirDatos(Arreglo) 
DesplegarArreglo(Arreglo) 
Print   , "\n" ,  
Sumacolumnas(Arreglo) 
Print   , "\n" ,  
SumaRenglones(Arreglo) 
Print   , "\n" ,  
SumaDiagonar(Arreglo) 
Print   , "\n" ,  
SumaDiagonalInv(Arreglo) 
Fin main


int IntroducirDatos(int Arreglo[4][4])
{ int R, C 
randomize() 
for(R=0    R<4    R++)
{ for(C=0    C<4    C++)
{ Arreglo[R][C]=random(100)+1  }}
return Arreglo[R][C]  }

void DesplegarArreglo(int Arreglo[4][4])
{int R, C 
Print   , " C1    C2    C3    C4" ,  
for(R=0    R<4    R++)
{ for(C=0    C<4    C++)
 {Print   , " " , Arreglo[R][C] , setw(4)  }
 Print   ,  }}

void Sumacolumnas(int Arreglo[4][4])
{ int R, C, CA=0 
 Print   , "Suma de columnas" ,  
for(C=0    C<4    C++)
{ CA=0 
for(R=0    R<4    R++)
{CA=CA+Arreglo[R][C]  }
Print   , "Colmna " , (C+1) , "= " , CA ,  }}

void SumaRenglones(int Arreglo[4][4])
{ int R, C, RE=0 
Print   , "Suma de renglones" ,  
for(R=0    R<4    R++)
{RE=0 
for(C=0    C<4    C++)
{ RE=RE+Arreglo[R][C]  }
Print   , "Renglon " , (R+1) , "= " , RE ,  }}

void SumaDiagonar(int Arreglo[4][4])
{ int R, D=0 
for(R=0    R<4    R++)
{D=D+Arreglo[R][R]  }
Print   , "Suma Diagonal= " , D ,  }

void SumaDiagonalInv(int Arreglo[4][4])
{ int R, C, DI=0 
C=3 
for(R=0    R<4    R++)
{DI=DI+Arreglo[R][C]  }
C-- 
Print   , "Suma Diagonal inversa= " , DI ,  }



Problema 3
 GARCIA GAETA FRNACISCO ARMANDO NO.CONTROL: 11211033
 UNA COMPAÑIA MANUFACTURERA TIENEN 12 PLANTAS ELABORAR UN PROGRAMA QUE PERMITA
 LEER EL NOMBRE DE CADA PLANTA Y LA PRODUCCION EN CADA UNO DE LOS 7 DIAS DE LA
 SEMANA. UTILIZAR UNA ARREGLO0 DEUNA DIIMENSION PARA LEER LOS NOMBRES DE LAS
 PLANTAS Y UNO DE DOS DIMENSIONES PARA LEER LA PRODUCCION DE LAS 12 PLANTAS EN
 LOS 7 DIAS UNA COLUMNA PARA CADA DIA. LA IDEA ES LEER EL NOMBRE DE LA PRIMERA
 PLANTA Y LUEGO LA PRODUCCION EN CADA UNO DE LOS 7 DIAS DE LA SEMAN LUGO
 PROCESAR EL 2,3 Y ASI SUCESIVAMENTE.
 IMPRIMA EL SIGUIENTE REPORTE:                                                    PRODUCCION
 PLANTA            DIA1     DIA2     DIA3     DIA4     DIA5     DIA6     DIA7      SEMANAL
 .
 .
 .
TOTALES:
PLANTA MAS PRODUCTIVA:
PRODUCCION DE LA PLANTA MAS PRODUCTIVA:
DIA DE MAYOR PRODUCCION:
MAYOR PRODUCCION EN UN DIA:
Pseudocodigo:
1.       Inicio.

int DatosProduccion(int Produccion[10][7], char NameE[10][30])   
void SumarProduccionSemanal(int Produccion[10][7], int PS[10])   
void SumarProduccionDia(int Produccion[10][7], int PD[7])   
void PlantaMayorProduccion(int Produccion[10][7], int & Mayor, int & PosMayor)   
void DesplegarDatos(int Produccion[10][7], char NameE[10][30], int PS[10], int PD[7])   
void DiaMayorPoduccion(int Produccion[10][7], int & Dia, int & MPD)   

int main()
{ int P[10][7], M, PM, PS[10], PD[7], Dia, MPD   
char N[10][30]   
Print "Ingresar Datos de las Empresas",      
DatosProduccion(P, N)   
SumarProduccionSemanal(P, PS)   
SumarProduccionDia(P, PD)   
DesplegarDatos(P, N, PS, PD)   
PlantaMayorProduccion(P, M, PM)   
DiaMayorPoduccion(P, Dia, MPD)   
Print "Planta mas productiva:",  N[PM],      
Print "Produccion de la Planta mas Productiva:",  M,      
Print "Dia con mayor produccion:",  Dia,      
Print "Mayor produccion en un dia:",  MPD,      
getch();    }

 int DatosProduccion(int Produccion[10][7], char NameE[10][30])
 { ramdomize();   
 int R, C   
 for(R=0      R<10      R=R+1)
 { Print "Nombre de la Empresa ",  (R+1),  ":"   
 gets(NameE[30])   
 for( C=0      C<7      C=C+1)
 { Produccion[R][C]=rand(5000)+1    }}
 return Produccion[R][C]    }

 void SumarProduccionSemanal(int Produccion[10][7], int PS[10])
 { int R, C, suma=0   
  for(R=0      R<10      R=R+1)
 { suma=0   
 for( C=0      C<7      C=C+1)
 { suma=suma+Produccion[R][C]    }
 PS[R]=suma    }}

 void SumarProduccionDia(int Produccion[10][7], int PD[7])
 { int R, C, suma=0   
 for( C=0      C<7      C=C+1)
 { suma=0   
 for(R=0      R<10      R=R+1)
 { suma=suma+Produccion[R][C]    }
 PD[C]=suma    }}

 void DiaMayorPoduccion(int Produccion[10][7], int & Dia, int & MPD)
 {int C   
 Dia=0   
 MPD=0   
 for(C=0      C<7      C++)
 { if(Produccion[10][C]>Dia)
 { Dia=Produccion[10][C]    }
 MPD=C    }}

 void PlantaMayorProduccion(int Produccion[10][7], int & Mayor, int & PosMayor)
 { int R   
 Mayor=0   
 PosMayor=0   
 for(R=0      R<10      R=R+1)
 { if(Produccion[R][7]>Mayor)
 { Mayor=Produccion[R][7]    }
 PosMayor=R    }}

 void DesplegarDatos(int Produccion[10][7], char NameE[10][30], int PS[10], int PD[7])
 { int R, C   
 Print " Planta               Dia1    Dia2    Dia3    Dia4    Dia5    Dia6    Dia7    Prod.Semanal",      
 for(R=0      R<10      R=R+1)
 {Print NameE[R]    for( C=0      C<7      C=C+1){Print setw(15),  Produccion[R][C],  setw(3)    }Print " ",  PS[R],      }
 Print "Totales:",  setw(15)   
 for(C=0      C<7      C++){Print PD[C],  setw(3)    }}