-->
当前位置:首页 > 题库

PROGRAMMING:progress bar

Luz5年前 (2021-05-10)题库491
The progress bar is often used to show the progress of a work when the user is waiting for a long time, so as to improve the user experience. Please write a program to generate the progress bar of specified times (input times from keyboard and use it as random seed) by using random function.
###Input format:
Enter a positive integer to specify the number of progress bars to display (at the same time, use this number as the random seed of srand())
###Output format:
The display of a progress bar is as follows:
1) We use 1 + rand ()% 35 to generate a random schedule;
2) The progress is occupied by 35 characters, the completed ones are represented by several > and the unfinished ones are represented by several;
3) Finally, the percentage of progress is displayed (the data occupies three places, and only the integral part is retained).
###Input example:
```in
six
```
###Output example:
```out
>>>>>>>>>>>>>>>>>>>>>>............. 63%
>>>>>>............................. 17%
>>>>>>>>........................... 23%
>>>>>>>>>>>>>>>>>>>>>>>>>>......... 74%
>>>>>>>>>.......................... 26%
>>>>>>>>>>>........................ 31%
```







answer:If there is no answer, please comment