C ++ implements the progress bar directly on the console interface, and it is fun to move it backwards.

Source: Internet
Author: User

2010-02-21 16:02:15

 

C ++ implements the progress bar on the console interface,

Then it's really fun to go over. Thank you for testing.

 

# Include <iostream> <br/> # include <windows. h> <br/> using namespace STD; </P> <p> int main () <br/> {<br/> system ("color 2f "); <br/> int A = 2, M = 21, D = 1; <br/> int P = 3; <br/> setconsoletitle ("VC ++ simple progress bar to move backwards"); // set the title </P> <p> for (INT I = 0; I <22; I ++) <br/>{< br/> sleep (30); <br/> system ("CLS "); </P> <p> setconsoletextattribute (getstdhandle (std_output_handle), 4 | background_blue ); // some colors are added <br/> cout <"too many colors available when there are too many other colors available" <endl; <br/> cout <"outputs"; </P> <p> for (INT x = 20; x> I; X --) <br/>{</P> <p> If (x = 0) <br/> cout <"commandid "; <br/> else <br/> cout <"tests"; <br/>}</P> <p> If (M = 0) <br/>{< br/> for (INT r = 0; r <22; r ++) <br/>{< br/> sleep (120 ); <br/> system ("CLS "); <br/> cout <"zookeeper" <Endl; <br/> cout <"handle"; <br/> setconsoletextattribute (getstdhandle (std_output_handle), 3 ); // Add some colors <br/> for (Int J = 0; j <r; j ++) <br/>{< br/> If (j = 20) <br/> cout <"commandid "; <br/> else <br/> cout <"plugin"; <br/>}< br/> cout <Endl; <br/> cout <"zookeeper" <Endl; <br/> D = 0; <br/>}</P> <p> If (d) <br/>{< br/> cout <Endl; <br/> cout <"zookeeper" <Endl; <br/> m --; <br/>}</P> <p> return 0; <br/>}</P> <p>

 

Click here for details about Baidu space. Thank you. (VC ++ implements the progress bar Effect in a simple way)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.