// 2a.cpp
#include <iostream>
#include <cstring>
using namespace std;
typedef struct{
char nombre[4];
char cantante[4];
char genero;
} Cancion;
const int M = 10;
void repCantante(Cancion *can){
cout<<"\nCanciones de mis autores favoritos"<<endl;
cout<<"Canción\t\tCantante\tGénero"<<endl;
for(int i=0; i<M; i++, can++)
if(strcmp(can->cantante, " ")) // verifica si es igual a
cout<<can->nombre<<"\t\t"<<can->cantante<<"\t\t"<<can->genero<<endl;
}
void repGenero(Cancion *can){
cout<<"\nCanciones de mis géneros favoritos"<<endl;
cout<<"Canción\t\tCantante\tGénero"<<endl;
for(int i=0; i<M; i++, can++)
if(can->genero != ' ')
cout<<can->nombre<<"\t\t"<<can->cantante<<"\t\t"<<can->genero<<endl;
}
int main(){
Cancion can [M] = { "abc", "yo ", 'A',
"def", "yo ", 'B',
"ghi", "yo ", ' ',
"jkl", "yo ", ' ',
"mno", "tu ", 'B',
"pqr", "tu ", ' ',
"stu", "tu ", 'A',
"vWx", "el ", 'A',
"yZ ", " ", 'A',
"ab ", " ", 'B'
};
repCantante(can);
repGenero(can);
}