Facebook
From jd, 5 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 233
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8.         int a,b;
  9.         int t[10][10];
  10.         srand(time(NULL));
  11.         cout<<"Wojciech Rudlicki"<<endl;
  12.         cout<<"Podaj przedzial losowania:";
  13.         cin>>a;
  14.         cin>>b;
  15.         for(int i=0;i<10;i++)
  16.         {
  17.                 for(int j=0;j<10;j++)
  18.                 {
  19.                         t[i][j]=rand()%(b+1-a)+a;
  20.                         cout<<t[i][j]<< " ";
  21.                 }
  22.                 cout<<endl;
  23.         }
  24.         cout<<endl;
  25.         for(int i=0;i<10;i++)
  26.         {
  27.                 for(int j=0;j<10;j++)
  28.                 {
  29.                 if(i==j)
  30.                 {
  31.                         cout<<"! ";
  32.                 }
  33.                 else
  34.                 {
  35.                         cout<<t[i][j];
  36.                 }
  37.                 cout<<endl;
  38.         }
  39.         system("pause");
  40.         return 0;
  41. }
  42. }