Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- void cifre(char s[101])
- {
- cout<<"Ex 1"<<endl;
- int i=0;
- cin.get(s,100);
- while(i<strlen(s))
- {
- if(s[i]<'0' || s[i]>9)
- strcpy(s+i,s+i+1);
- else
- i++;
- }
- if(strlen(s)!=0)
- cout<<s;
- else
- cout<<"SIR VID";
- }
- void faraCon(char s[101])
- {
- cout<<"Ex 2"<<endl;
- int i=0;
- cin.get(s,100);
- while(i<strlen(s))
- {
- if(strchr("aeiou",s[i])==NULL)
- strcpy(s+i,s+i+1);
- else
- i++;
- }
- if(strlen(s)!=0)
- cout<<s;
- else
- cout<<"SIR VID";
- }
- void alfabetic(char s[101])
- {
- cout<<"Ex 3"<<endl;
- int fr[201]={0},i;
- cin.get(s,100);
- for(i=0;i<strlen(s);i++)
- if(s[i]>='a'&& s[i]<='z'&& fr[s[i]]==0)
- {
- fr[s[i]]=1;
- cout<<s[i]<<" ";
- }
- }
- void cuvinte(char s[101])
- {
- cout<<"Ex 4"<<endl;
- char *p;
- cin.get(s,100);
- int k=0,k1=0,i=0;
- p=strtok(s," ");
- while(i<strlen(s))
- {
- if(strchr("aeiou",s[0]))
- k1++;
- p=strtok(NULL," ");
- k++;
- i++;
- }
- cout<<k<<" "<<k1;
- }
- int main()
- {
- char s[101];
- //cifre(s);
- //faraCon(s);
- //alfabetic(s);
- cuvinte(s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement