Created
November 27, 2012 16:17
-
-
Save vertrigo/4155180 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,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)==*(st+i+1)) | |
| { | |
| k=1; | |
| printf("В строке присутствуют удвоенные символы:\n"); | |
| printf("%c",st[i]); | |
| printf("%c\n",st[i+1]); | |
| } | |
| } | |
| if (!k) | |
| { | |
| printf("В строке нет удвоенных символов"); | |
| } | |
| 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,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)==*(st+i+1)) | |
| { | |
| k=1; | |
| printf("V stroke est udvoennie simvoli:\n"); | |
| printf("%c",st[i]); | |
| printf("%c\n",st[i+1]); | |
| } | |
| } | |
| if (!k) | |
| { | |
| printf("V stroke net udvoennih simvolov"); | |
| } | |
| getch(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment