隨手弄弄的作品...
就...橫桿轉呀轉的同時顯示進度...
#include <cstdlib>
#include <iostream>
using namespace std;
void Delay()
{
for(int i=0; i<60000000; i++)
{
//用於時間延遲的副程式
}
}
int main(int argc, char *argv[])
{
for(int i=1; i<=100; i++)
{
if(i % 4 == 0)
{
cout << "|" << " . " << i << "%";
}
else if(i % 4 == 1)
{
cout << "/" << " .. " << i << "%";
}
else if(i % 4 == 2)
{
cout << "─" << " ... " << i << "%";
}
else if(i % 4 == 3)
{
cout << "\" << " .... " << i << "%";
}
Delay();
system("CLS");
}
system("PAUSE");
return EXIT_SUCCESS;
}
沒有留言:
張貼留言