#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char N[7][4]={"DO","RE","MI","FA","SOL","LA","SI"};
char s[101];
int gasit=0;
cin.getline(s,101);
char *p=strtok(s," ");
while(p)
{
int ok=0;
for(int i=0;i<7;i++)
if(strstr(p,N[i]))
ok=1;
if(ok)
{
cout<<p<<endl;
gasit=1;
}
p=strtok(NULL," ");
}
if(!gasit) cout<<"nu exista";
return 0;
}
|