Guest User

Untitled

a guest
Feb 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <time.h>
  4. #include "papildus.h"
  5.  
  6. const int zhur_num = 25;
  7. const int mag_sk = 2;
  8.  
  9. const int a = 17;
  10. const int b = 2;
  11.  
  12. int rindas = a+1;
  13. int kolonnas = b+1;
  14.  
  15. int masivs[18][3];
  16.  
  17. int main()
  18. {
  19.     int temp = rindas - 1;
  20.     srand(time(NULL));
  21.     for(int i = 0; i < rindas; i++)
  22.     {
  23.         for(int j = 0; j < kolonnas; j++)
  24.         {
  25.             if(i==j)
  26.             {
  27.                 temp++;
  28.                 krasa(0,15);
  29.                 masivs[i][j] = temp;
  30.                 printf("%4d",masivs[i][j]);
  31.                 krasa(7,0);
  32.             }
  33.             else
  34.             {
  35.                 masivs[i][j] = rand()%89+10;
  36.                 printf("%4d",masivs[i][j]);
  37.             }
  38.         }
  39.         printf("\n");
  40.     }
  41.     krasa(0,7);
  42.     gotoxy(5,20);
  43.     printf("Davis Zalitis   D3-1");
  44.     gotoxy(5,21);
  45.     time_t secs=time(0);
  46.     tm *t=localtime(&secs);
  47.     printf("%2d / %2d / %2d",t->tm_mday,t->tm_mon+1,t->tm_year+1900);
  48.     gotoxy(5,22);
  49.     printf("Z.num = 25, M.sk = 2, programmaa Z.num samazinaats uz 17");
  50.     gotoxy(5,23);
  51.     printf("Kolonnas = 3(M.sk + 1), Rindas = 18(Z.num + 1)\n");
  52.     getchar();
  53. }
Add Comment
Please, Sign In to add comment