Skip to content

Instantly share code, notes, and snippets.

@vertrigo
Created November 27, 2012 18:16
Show Gist options
  • Select an option

  • Save vertrigo/4155998 to your computer and use it in GitHub Desktop.

Select an option

Save vertrigo/4155998 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
int i,k;char *st="";
clrscr();
printf("vvedite stroku:\n");
scanf("%s",st);
printf("ishodn. stroka:\n%s\n",st);
i=0;
while (i<strlen(st)) {
if (*(st+i)=='.')
{
for (k=strlen(st);k>=i;k--){
*(st+k+2)=*(st+k);}
for (k=i; k<=i+2; k++){
*(st+k)='.';}
i+=2;
}
if (*(st+i)=='!')
{
*(st+i)='*';
}
i++;
}
printf("resultat:\n%s\n",st);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment