- #include <stdio.h>
- int main()
- {
- int lotsa = 100;
- printf("working:\n");
- for (int i = 0;i < lotsa;i++)
- {
- printf("\r%3d%%",(int)(100L * i / lotsa));
- }
- printf("\ndone.\n");
-
- printf("working:");
- for(int i = 0;i < lotsa;i++)
- {
- printf("%c\b","|/-\\"[i%4]);
- fflush(stdout);
- }
- printf("done.\n");
- return 0;
- }
复制代码
|