比较难琢磨的题
怎么用C语言实现 打印输出效果啊能控制输出速度
比如输出 abcdefg 1秒弹出一个 或是N秒
2004-09-14 19:34

2004-09-14 19:44
2004-09-14 19:57
#include <stdio.h> #include <dos.h>
int main () { printf("a"); sleep(1); printf("b"); sleep(1); printf("c"); sleep(1); printf("d"); sleep(1); }
--------------------Configuration: dos - Win32 Debug-------------------- Compiling... dos.cpp E:\cpp\dos.cpp(7) : error C2065: 'sleep' : undeclared identifier E:\cpp\dos.cpp(14) : warning C4508: 'main' : function should return a value; 'void' return type assumed 执行 cl.exe 时出错.
dos.exe - 1 error(s), 0 warning(s)

2004-09-14 20:02
靠,那么有100个字符你不是要用100个printf??
int main () { char *s="1234567890",*a; a=s; while(*a) { printf("%c",*a++); sleep(1); } printf("\n"); a=s; while(*a) { printf("\b%c",*a++); sleep(1); }
}

2004-09-14 20:08
2004-09-14 20:12
2004-09-14 20:13
2004-09-14 20:14

2004-09-14 20:14
2004-09-14 20:16