Advertisement
Guest User

Untitled

a guest
May 30th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2.  
  3. #include <stdio.h>
  4. #include<conio.h>
  5. //---------------------------------------------------------------------------
  6.  
  7. void vvod(int*,int*);
  8. void ras(int,int);
  9. void vivod(int,int);
  10.  
  11. int a[10][10];
  12.  
  13. void main(void)
  14. {
  15. int n,m;
  16. vvod(&n,&m);
  17. ras(n,m);
  18. vivod(n,m);
  19. getch();
  20. }
  21.  
  22. void vvod(int*n,int*m)
  23. {
  24. int i,j;
  25. printf("Razmernost:\n");
  26. scanf("%d %d",n,m);
  27. printf("Vvedite elementi massiva:\n");
  28. for(i=0; i<(*n); i++)
  29. for(j=0; j<(*m); j++)
  30. scanf("%d",&a[i][j]);
  31. printf("\n");
  32. }
  33.  
  34. void ras(int n,int m)
  35. {
  36. int i,j;
  37. for(i=0; i<n; i++)
  38. for(j=0; j<m; j++)
  39. if(a[i][j]<j)
  40. a[i][j]=0;
  41. }
  42. void vivod(int n,int m)
  43. {
  44. int i,j;
  45. for(i=0; i<n; i++)
  46. {for(j=0; j<m; j++)
  47. printf("%d ",a[i][j]);
  48. printf("\n");}
  49. }
  50.  
  51. //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement