Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- char *rumdreh(char *str){
- int i, r,l,j;
- char safe;
- r = strlen(str)-1;
- l = 0;
- while(l<r){
- safe = str[l];
- str[l] = str[r];
- str[r] = safe;
- l +=1;
- r -=1;
- }
- return str;
- }
- int main () {
- char str[50];
- char ersatz[64];
- int len;
- int i, r,l,j;
- int count = 0;
- char safe;
- char vocals[] = "aeiou";
- char copy[64];
- strcpy(str, "A23lloc 23 a1 te2d");
- for(i=0;i<strlen(str);i++){
- if(!isdigit(str[i])){
- ersatz[count] = str[i];
- count +=1;
- }
- }
- printf("%d\n", strlen(ersatz));
- printf("%s\n", ersatz);
- r = strlen(ersatz)-1;
- l = 0;
- while(l<r){
- safe = ersatz[l];
- ersatz[l] = ersatz[r];
- ersatz[r] = safe;
- l +=1;
- r -=1;
- }
- int idx = 0;
- char newest[64];
- for(i=0;i<strlen(ersatz);i++){
- if(!(ersatz[i] == ' ')){
- newest[idx] = ersatz[i];
- idx +=1;
- }
- }
- newest[idx] = '\0';
- for(i=0;i<strlen(newest);i++){
- for(j=0;j<strlen(vocals);j++){
- if(newest[i] == vocals[j]){
- newest[i] = toupper(vocals[j]);
- break;
- }
- }
- }
- strcpy(ersatz, newest);
- strcpy(copy, ersatz);
- strcat(ersatz, rumdreh(copy));
- printf("%s\n", ersatz);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement