Advertisement
vallec

marcus rashford

Jan 17th, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. printf("Da se sustavi programa za obrabotka na masiva D[M,M], kudeto dannite sa chisla v intervala [-999.9;999.99]. Programata da izvurshi slednite deistviq:\n");
  6. printf("Vsichki chisla izvun intervala A - B da se zamenqt s tqhnata udvoena stoinost. Sled tova matricite da se transponirat.\n");
  7. printf("Avtor: ..........\n");
  8.  
  9. int n;
  10.  
  11. printf("Vavedi golemina na D: ");
  12. scanf("%d", &n);
  13. double D[n][n];
  14. double D2[n][n];
  15.  
  16. for(int i = 0; i < n; i++){
  17. for(int j = 0; j < n; j++){
  18. printf("D[%d][%d] = ", i, j);
  19. scanf("%lf", &D[i][j]);
  20. }
  21. }
  22.  
  23. printf("---------------\n");
  24.  
  25. for(int i = 0; i < n; i++){
  26. for(int j = 0; j < n; j++){
  27. printf("D[%d][%d] = %lf\n", i, j, D[i][j]);
  28. }
  29. }
  30.  
  31. printf("---------------\n");
  32.  
  33. int a, b;
  34.  
  35. printf("Vavedi A: ");
  36. scanf("%d", &a);
  37. printf("Vavedi B: ");
  38. scanf("%d", &b);
  39.  
  40. for(int i = 0; i < n; i++){
  41. for(int j = 0; j < n; j++){
  42. if(D[i][j] < a || D[i][j] > b){
  43. D[i][j] = D[i][j] * 2;
  44. }
  45. }
  46. }
  47.  
  48.  
  49.  
  50. for (int i = 0; i < n; ++i)
  51. for (int j = 0; j < n; ++j)
  52. D2[j][i]= D[i][j];
  53.  
  54. printf("---------------\n");
  55.  
  56. for(int i = 0; i < n; i++){
  57. for(int j = 0; j < n; j++){
  58. printf("D[%d][%d] = %lf\n", i, j, D2[i][j]);
  59. }
  60. }
  61.  
  62. return 0;
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement