/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX_STRING_SIZE 256
#define MAX_TOKEN_SIZE 25
void fun(const char* str) {
char* buffer=calloc(MAX_STRING_SIZE,sizeof(char));
char token[MAX_TOKEN_SIZE];
int count=0;
int flip=1;
while (count<strlen(str)){
sscanf(&str[count], "%[^.]s", token);
count+=strlen(token)+1;
if(flip){
memcpy(&buffer[strlen(buffer)],token,strlen(token));
sprintf(&buffer[strlen(buffer)], ".abc.");
}
flip = flip ? 0 : 1;
}
buffer[strlen(buffer)-1]='\0';
printf("%s",buffer);
free(buffer);
}
int main()
{ char a[]="hey.whats.that.over.there";
fun(a);
return 0;
}