Created
November 27, 2012 18:56
-
-
Save vertrigo/4156250 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <conio.h> | |
| #include <string.h> | |
| void main() | |
| { | |
| int i,j,k=0; | |
| char *st=""; | |
| clrscr(); | |
| printf("Введите строку: \n"); | |
| scanf("%s",st); | |
| printf("\nИсходная строка: \n%s \n",st); | |
| for(i=0;i<strlen(st)-1;i++){ | |
| if (*(st+i)== 'A' && *(st+i+1) == 'B') | |
| { | |
| *(st+i) = 'C'; | |
| for(j=i+1;j<strlen(st);j++) | |
| { | |
| *(st+j)=*(st+j+1); | |
| } | |
| } | |
| } | |
| printf("Полученная строка:\n%s",st); | |
| getch(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <conio.h> | |
| #include <string.h> | |
| void main() | |
| { | |
| int i,j,k=0; | |
| char *st=""; | |
| clrscr(); | |
| printf("Vvedite stroku: \n"); | |
| scanf("%s",st); | |
| printf("\nIshodnaja stroka: \n%s \n",st); | |
| for(i=0;i<strlen(st)-1;i++){ | |
| if (*(st+i)== 'A' && *(st+i+1) == 'B') | |
| { | |
| *(st+i) = 'C'; | |
| for(j=i+1;j<strlen(st);j++) | |
| { | |
| *(st+j)=*(st+j+1); | |
| } | |
| } | |
| } | |
| printf("Poluchennaja stroka:\n%s",st); | |
| getch(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment