#include #include #include #include #define get_time() (long)((clock()/(float)CLOCKS_PER_SEC)*1000) #define STR_LENGTH 80 #define HEIGHT 5 void set_timer(long msc) { long start = get_time(); while ((get_time() - start) < msc); } int main(int argc, char** argv) { int j, b, char_index, str_len; char *string = (char*) malloc(sizeof (char)*STR_LENGTH), curr_char; printf("Input string: "); scanf("%s", string); system("cls||clear"); printf("%s", string); set_timer(250); str_len = strlen(string); while (str_len) { curr_char = string[(char_index = --str_len / 2)]; for (j = char_index; string[j] != '\0'; j++) string[j] = string[j + 1];//смещение строки for (j = 1; j <= HEIGHT; j++) { system("cls||clear"); printf("%s", string); for (b = 1; b <= j; b++) printf("%c", '\n'); for (b = 0; b < char_index; b++) printf("%c", ' '); printf("%c", curr_char); set_timer(250); } } free(string); return 0; }