赞
踩
c++写的进度条 其实和c语言没什么大区别 只是用了c++的cin,cout
//IDE:dev-c++ #include <iostream> using namespace std; void cf_ProgressBar( int n ) { char c = (char)22; if( n!=1 ) { if( n%2 == 0 ) { cout << "/b/b/b/b/b"; cout << c << " "; if( n < 10 ) cout << " " << n << "%"; else cout << n << "%"; } else { cout << "/b/b/b"; if( n < 10 ) cout << " " << n << "%"; else cout << n << "%"; } } else { cout << " " << n << "%"; } } int main() { int n = 1; for( int i = 0;i < 1000000000;++i ) { if( !(i%10000000) ) { cf_ProgressBar( n ); ++n; } } system("pause"); return 0; }