void to_up char buff for int buff if buff buff buff return void to_dow

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
void to_up(char *buff){
for(int i=0;buff[i];i++){
if(buff[i]>='a' && buff[i]<='z')buff[i]+='A'-'a';
}
return;
}
void to_down(char *buff){
for(int i=0;buff[i];i++){
if(buff[i]>='A' && buff[i]<='Z')buff[i]-='A'-'a';
}
return;
}
void revers(char *buff){
int lenght=strlen(buff);
char t;
for(int i=0;i<=lenght/2;i++){
t=buff[i];
buff[i]=buff[lenght-1-i];
buff[lenght-1-i]=t;
}
return;
}
int isVowl(char ch){
char vowles[]="eyuioa";
for(int i=0;vowles[i];i++)if(vowles[i]==ch)return 1;
return 0;
}
int count_vowles(char *buff){
int num=0;
for(int i=0;buff[i];i++){
if(isVowl(buff[i]))num++;
}
return num;
}
void erase_spases(char *buff){
for(int i=0;buff[i];i++){
if(buff[i]==' ')
for(int j=i;buff[j];j++)buff[j]=buff[j+1];
}
return;
}