You are on page 1of 3

Dublare lit

#include<iostream>
#include<cstring>
using namespace std;
char s[260];
int i,r,t;
char c;
char p[260];
int main(){

cin.get(s,260);
cin>>c;
i=0;
while(s[i]!=0){
if(s[i]==c){
strcpy(p,s+i+1);
s[i+1]=c;
strcpy(s+i+2,p);
i+=2;

}
else i++;
}

for(i=0;s[i]!=0;i++){

cout<<s[i];
}
return 0;
}
Numard e consoane egal cu vocale e

#include<iostream>
#include<cstring>
using namespace std;
char s[21];
int i,a,b;
char c;
char p[260];
char v[]="aeiou";
int main(){
a=0;
b=0;
cin.get(s,20);
for(i=0;s[i]!=0;i++){
if(strchr(v,s[i])!=NULL){
a++;
}
else{
b++;
}

if(a==b){
cout<<"Da";
}
else{
cout<<"Nu";
}

return 0;
}

You might also like