Răspuns :
PROBLEMA 1 :
#include <iostream>
#include <cstring>
using namespace std;
int main(){
char txt[150], cuv[15][10];
cin.get(txt,150);
//Imparte textul in cuvinte
char *p=strtok(txt," ");
int i=0;
while(p != NULL){
strcpy(cuv[i++],p);
p=strtok(NULL," ");
}
//Inlocuieste prima litera cu cifra 9 si afisaza
for(int j=0;j<i;j++){
cuv[j][0] = '9';
cout << cuv[j] << " ";
}
}
PROBLEMA 2 :
#include <iostream>
#include <cstring>
using namespace std;
int main(){
char txt[150], cuv[15][10];
cin.get(txt,150);
//Imparte textul in cuvinte
char *p=strtok(txt," ");
int i=0;
while(p != NULL){
strlwr(strcpy(cuv[i++],p));
p=strtok(NULL," ");
}
//Verifica daca prima litera e vocala
bool vocala=1;
char vocale[] = "aeiou";
for(int j=0;j<i;j++){
if(strchr(vocale,cuv[j][0])==NULL){
vocala=0;
break;
}
}
//Afisare rezultat
if(vocala) cout << "Da, toate cuvintele incep cu vocala";
else cout << "Nu, nu toate cuvintele incep cu vocala";
}