Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- 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");
- printf("Vsichki chisla izvun intervala A - B da se zamenqt s tqhnata udvoena stoinost. Sled tova matricite da se transponirat.\n");
- printf("Avtor: ..........\n");
- int n;
- printf("Vavedi golemina na D: ");
- scanf("%d", &n);
- double D[n][n];
- double D2[n][n];
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- printf("D[%d][%d] = ", i, j);
- scanf("%lf", &D[i][j]);
- }
- }
- printf("---------------\n");
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- printf("D[%d][%d] = %lf\n", i, j, D[i][j]);
- }
- }
- printf("---------------\n");
- int a, b;
- printf("Vavedi A: ");
- scanf("%d", &a);
- printf("Vavedi B: ");
- scanf("%d", &b);
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- if(D[i][j] < a || D[i][j] > b){
- D[i][j] = D[i][j] * 2;
- }
- }
- }
- for (int i = 0; i < n; ++i)
- for (int j = 0; j < n; ++j)
- D2[j][i]= D[i][j];
- printf("---------------\n");
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- printf("D[%d][%d] = %lf\n", i, j, D2[i][j]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement