verondela Публикувано Март 5, 2008 Report Share Публикувано Март 5, 2008 Здравейте,може ли някой да ми каже къде греша в следната задача: условието е да се напише програма която изписва въведена дума на обратно. #include <iostream.h> #include <conio.h> void main() { char str[50], c; int x = -1, length; clrscr(); cout << "Введите текст: "; cin >> str; while (str[++x] != '\0'); length = x - 1; for (x = 0; x <= (length / 2); x++) { c = str[x]; str[x] = str[length - x]; str[length - x] = c; } cout << "Променен текст: " << str; getch(); } благодаря предварително Цитирай Link to comment Сподели другаде More sharing options...
Препоръчан пост
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.