fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cstdlib>
  4. #include <string>
  5. using namespace std;
  6.  
  7. void Draw(){
  8. }
  9.  
  10.  
  11. int main() {
  12. int D[6][6];
  13. int a = 1, b = 5;
  14. //cout<<"Enter the interval from A to B: ";
  15. //cin>>a>>b;
  16. const int width=33;
  17. const int height=6;
  18. for(int i=0;i<width+1;i++)
  19. {
  20. cout<<"#";
  21.  
  22. }
  23. cout<<endl;
  24. for(int i=0;i<6;++i)
  25. {
  26. cout << "# ";
  27. for(int j=0;j<6;++j)
  28. {
  29. D[i][j]=rand()%(b-a)+a;
  30. cout << setw(4) << D[i][j] << " ";
  31. }
  32. cout << " #\n";
  33. }
  34. for(int i=0;i<width+1;i++)
  35. {
  36. cout<<"#";
  37.  
  38. }
  39. cout<<endl;
  40. cout<<endl;
  41. return 0;
  42. }
  43.  
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout
##################################
#    4    3    2    4    2    4  #
#    3    1    2    2    3    4  #
#    3    4    4    3    1    3  #
#    1    1    4    1    4    2  #
#    3    3    3    4    4    4  #
#    2    3    3    3    2    4  #
##################################