Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char * sacaEspacios(char*frase){
- int pos=0;
- for(int i=0;i<strlen(frase);i++){
- if(frase[i]==32){
- pos = i+1;
- while(frase[i]==32){
- if(frase[pos]!=32){
- frase[i]=frase[pos];
- frase[pos]=32;
- }
- else{
- pos++;
- }
- }
- }
- }
- return 0;
- }
- char * aMayusculas(char*frase,int posinicial){
- static int pos=0;
- if(frase[pos]>96 && frase[pos]<123){
- frase[pos]=frase[pos]-32;
- }
- pos++;
- posinicial=pos;
- if(pos<strlen(frase)){
- aMayusculas(frase,posinicial);
- }
- return frase;
- }
- int esPalindroma(const char*frase,int posinicial, int posFinal){
- static int flag=0;
- static int i=0;
- if(frase[i]==frase[posFinal-i]){
- flag = 1;
- i++;
- if(i<posFinal){
- esPalindroma(frase, posinicial,posFinal);
- }
- else{
- return flag;
- }
- }
- else{
- flag =0;
- }
- if (flag==0){
- return 0;
- }
- return flag;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement