#include <iostream>
int main() {
float progress = 0.0;
while (progress < 1.0) {
int barWidth = 70;
std::cout << "[";
int pos = barWidth * progress;
for (int i = 0; i < barWidth; ++i) {
if (i < pos) std::cout << "=";
else if (i == pos) std::cout << ">";
else std::cout << " ";
}
std::cout << "] " << int(progress * 100.0) << " %\r";
std::cout.flush();
progress += 0.16; // for demonstration only
}
std::cout << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKSB7CiAgICBmbG9hdCBwcm9ncmVzcyA9IDAuMDsKICAgIHdoaWxlIChwcm9ncmVzcyA8IDEuMCkgewogICAgICAgIGludCBiYXJXaWR0aCA9IDcwOwogICAgCiAgICAgICAgc3RkOjpjb3V0IDw8ICJbIjsKICAgICAgICBpbnQgcG9zID0gYmFyV2lkdGggKiBwcm9ncmVzczsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGJhcldpZHRoOyArK2kpIHsKICAgICAgICAgICAgaWYgKGkgPCBwb3MpIHN0ZDo6Y291dCA8PCAiPSI7CiAgICAgICAgICAgIGVsc2UgaWYgKGkgPT0gcG9zKSBzdGQ6OmNvdXQgPDwgIj4iOwogICAgICAgICAgICBlbHNlIHN0ZDo6Y291dCA8PCAiICI7CiAgICAgICAgfQogICAgICAgIHN0ZDo6Y291dCA8PCAiXSAiIDw8IGludChwcm9ncmVzcyAqIDEwMC4wKSA8PCAiICVcciI7CiAgICAgICAgc3RkOjpjb3V0LmZsdXNoKCk7CiAgICAgICAgCiAgICAgICAgcHJvZ3Jlc3MgKz0gMC4xNjsgLy8gZm9yIGRlbW9uc3RyYXRpb24gb25seQogICAgfQogICAgc3RkOjpjb3V0IDw8IHN0ZDo6ZW5kbDsKICAgIAogICAgcmV0dXJuIDA7Cn0=