hmar %!s(int64=4) %!d(string=hai) anos
pai
achega
a1e6e860ca
Modificáronse 1 ficheiros con 12 adicións e 7 borrados
  1. 12 7
      test.c

+ 12 - 7
test.c

@@ -1,18 +1,23 @@
 #include <stdio.h>
 
-float a[10000][10000];
-
+float a[2000][2000];
+float b[2000][2000];
 int main(int argc, char *argv[])
 {
 	float sum = 0;
-	for (int i=0; i<10000; i++){
-		for (int j=0; j<10000; j++){
+	for (int i=0; i<2000; i++){
+		for (int j=0; j<2000; j++){
 			a[i][j] = (i+j)/10000.0;
 		}
 	}	
-	for (int j=0; j<10000; j++){
-		for (int i=0; i<10000; i++){
+	for (int j=0; j<2000; j++){
+		for (int i=0; i<2000; i++){
 			sum = sum + a[i][j];
 		}
-	}	
+	}
+	for (int i=0; i<2000; j++){
+		for (int i=0; i<2000; i++){
+			b[i][j] = a[i][j];
+	                }
+        }	
 }