From ee38e0e95e8d089670f07eb3da671e232242ea55 Mon Sep 17 00:00:00 2001 From: mgandy0123 Date: Fri, 4 Mar 2022 15:30:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B3=B0=E6=AF=85++?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 7bb099d..5e10cba 100644 --- a/readme.md +++ b/readme.md @@ -9,3 +9,4 @@ 3. 繼續寫下去 XD 4. 大家來簽到吧 5. 這是一個測試 +6. Binchiling! 峰 From 86f31987b2094f31fb1a65e35b75c093d3a9c7ca Mon Sep 17 00:00:00 2001 From: mgandy0123 Date: Wed, 9 Mar 2022 22:04:23 +0800 Subject: [PATCH 2/2] Chen Feng-Yi 5_prcatice.c finish the code --- 5_practice.c | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/5_practice.c b/5_practice.c index 70d6651..b69de9b 100644 --- a/5_practice.c +++ b/5_practice.c @@ -2,39 +2,47 @@ #include // for memory allocation #include // for time calculation #include // for sine and cosine functions + int main() { // Declare all the variables - int k, n, N; + int u ,k, n, N; double *x, *yr, *yi; time_t t; // Input the number N - - + printf("Please input a number N = "); + scanf("%d", &N); // Locate the memory for x, yr, yi; - - // Initial setting for x, for example, x[k] = k - - - - + x = (double *) malloc(N*sizeof(double)); + yr = (double *) malloc(N*sizeof(double)); + yi = (double *) malloc(N*sizeof(double)); + + // Initial setting for x, for example, x[k] = k, k=0..N-1 + for(k=0;k