Facebook
From Whipped Prairie Dog, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 209
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <windows.h>
  4. #include <time.h>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main(int argc, char** argv) {
  10.  
  11.         int i,j,t[10][10],x,w=0,k=0,suma=0;
  12. //      int sw[x],sk[x];
  13.        
  14.         srand(time(0));
  15.        
  16.         for(int j=0; j<10; j++)
  17.         {
  18.                 for(int i=0; i<10; i++)
  19.                 {
  20.                         x=(std::rand()%201)-100;
  21.                         t[j][i]=x;
  22.                         suma=suma+t[j][i];
  23.                 }
  24.         }
  25.        
  26.         for(int w=0; w<10; w++)
  27.         {
  28.                 for(int k=0; k<10; k++)
  29.                 {
  30.                         cout<<t[w][k]<<" ";
  31.                 }
  32.                 cout<<endl;
  33.         }
  34.        
  35.        
  36.         cout<<endl<<"Suma ww. wynosi: "<<suma;
  37.  
  38.         return 0;
  39. }