fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <windows.h>
  5. #include <conio.h>
  6. #include <iomanip>
  7. #include <iostream>
  8. using namespace std;
  9.  
  10. char ch;
  11. int count=0;
  12. int main()
  13. {
  14. srand(time(0));
  15. int a[10];
  16. for (int j=0;j<10;j++)
  17. a[j]=1;
  18. do
  19. {
  20. Sleep(.00000005);
  21. system("cls");
  22. int i=rand()%10;
  23. a[i]++;
  24. count++;
  25. for( int j=0;j<10;j++) cout<<setw(2)<<j<<": "
  26. <<setiosflags(ios::left)<<setw(3)<<setiosflags(ios::showpoint)<<setprecision(3)
  27. <<((float)count/(float)a[j])<<"%"<<endl<<endl;
  28. cout<<count;
  29. }
  30.  
  31. while (!kbhit());
  32.  
  33. return 0;
  34. }
  35.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
stdout
Standard output is empty