Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main(){
- printf("------------------------------------\n");
- printf("ПРОГРАММА ДЛЯ ИЗМЕНЕНИЯ СТРОКИ:\n");
- printf("------------------------------------\n");
- char a[256], temp, *first, *last; //Указатели на массив
- printf("Введите строку: ");
- fgets(a, 256, stdin); //Функция ввода строки
- printf("ИЗМЕНЕННАЯ СТРОКА: ");
- for (first = a, last = a + strlen(a) - 1; first < last; first++, last--) {
- temp = *first;
- *first = *last;
- *last = temp;
- }
- printf("%s\n", a);
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement