码迷,mamicode.com
首页 > 其他好文 > 详细

好玩的代码(1)

时间:2014-10-09 20:34:17      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   使用   ar   for   sp   

看效果(gif工具不太会用,效果不是很好)

代码很简单,就是对sleep函数和/b的使用。

bubuko.com,布布扣

代码

 1 #include <cstdio>
 2 #include <windows.h>
 3 using namespace std;
 4 
 5 int main(int argc, char **argv)
 6 {
 7     printf("Connecting server:192.168.0.1 \\");
 8     for(int i = 0;i < 1000;++i)
 9     {
10         printf("\b\\");
11         Sleep(100);
12         printf("\b|");
13         Sleep(100);
14         printf("\b/");
15         Sleep(100);
16     }
17 
18     return 0;
19 }

 

好玩的代码(1)

标签:style   blog   http   color   io   使用   ar   for   sp   

原文地址:http://www.cnblogs.com/lit10050528/p/4013926.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!