From bdac6cf3e4e69b1643a88ad52813b6b3c38705a5 Mon Sep 17 00:00:00 2001 From: pecp45i32 Date: Fri, 29 Nov 2024 22:10:10 +0800 Subject: [PATCH] =?UTF-8?q?Delete=20'=E6=AD=A5=E9=AA=A4=E4=B8=83.cpp'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 步骤七.cpp | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 步骤七.cpp diff --git a/步骤七.cpp b/步骤七.cpp deleted file mode 100644 index d7d81c2..0000000 --- a/步骤七.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include - -#define SIZE 100 - -void matmul(float A[SIZE][SIZE], float B[SIZE][SIZE], float C[SIZE][SIZE], int n) { - for (int i = 0; i < n; i++) { - for (int j = 0; j < n; j++) { - float sum = 0.0f; - for (int k = 0; k < n; k++) { - sum += A[i][k] * B[k][j]; - } - C[i][j] = sum; - } - } -} - -int main() { - float A[SIZE][SIZE], B[SIZE][SIZE], C[SIZE][SIZE]; - - - srand(time(NULL)); - for (int i = 0; i < SIZE; i++) { - for (int j = 0; j < SIZE; j++) { - A[i][j] = rand() % 101; - B[i][j] = rand() % 101; - C[i][j] = 0; - } - } - - - matmul(A, B, C, SIZE); - - - printf("Result matrix C (partial):\n"); - for (int i = 0; i < 10; i++) { - for (int j = 0; j < 10; j++) { - printf("%.2f ", C[i][j]); - } - printf("\n"); - } - - return 0; -} \ No newline at end of file