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)