Guest User

Untitled

a guest
Oct 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. char * codifica (char *str);
  4.  
  5. int main()
  6. {
  7. char chain[30];
  8. scanf(" %29[^\n]",chain);
  9. int k;
  10. for(k=0;chain[k]!='\0';k++);
  11. char*resp;
  12. resp=(char*)malloc(sizeof(char)*k);
  13. resp=codifica(chain);
  14. for(int i=0;i<k;i++)printf("%c",resp[i]);
  15.  
  16. return 0;
  17. }
  18.  
  19. char * codifica (char *str){
  20. for(int i=0;str[i]!='\0';i++){
  21. if(str[i]==97||str[i]==101)str[i]='?';
  22. else if(str[i]==105||str[i]==111||str[i]==117)str[i]='?';
  23. }
  24. return str;
  25. }
Add Comment
Please, Sign In to add comment