Skip to content

Instantly share code, notes, and snippets.

@vertrigo
Created December 9, 2012 12:47
Show Gist options
  • Select an option

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

Select an option

Save vertrigo/4244700 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
int i,j,n,k=0;
char *st="";
clrscr();
printf("Vvedite stroku: \n");
gets(st);
printf("\nIshodnaja stroka: \n");
puts(st);
i=0;
while (i<strlen(st)) {
if ((*(st+i)=='.') && (*(st+i+1)!=' '))
{
for (k=strlen(st); k>=i; k--)
{
*(st+k+1)=*(st+k);
}
*(st+i+1)=' ';
}
i++;
}
printf("\nPoluchennaja stroka:\n");
puts(st);
getch();
}
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
int i,j,n,k=0;
char *st="";
clrscr();
printf("Введите строку: \n");
gets(st);
printf("\nИсходная строка: \n");
puts(st);
i=0;
while (i<strlen(st)) {
if ((*(st+i)=='.') && (*(st+i+1)!=' '))
{
for (k=strlen(st); k>=i; k--)
{
*(st+k+1)=*(st+k);
}
*(st+i+1)=' ';
}
i++;
}
printf("\nРезультат:\n");
puts(st);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment