-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.c
More file actions
51 lines (41 loc) · 1.8 KB
/
example.c
File metadata and controls
51 lines (41 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(lib, "C2DLibrary.lib")
#include<stdio.h>
#include<stdint.h>
#include "C2DLibrary.h"
int main()
{
int n, m;
printf("�и��� ������ �Է��ϼ���: ");
scanf("%d", &m);
double* a;
a = (double*)malloc((int64_t)sizeof(double) * (int64_t)(m + 1));
printf("�и��� ����� ������� �ְ����ױ��� ������� �Է��ϼ���: ");
for (int i = 0; i <= m; i++)scanf("%lf", a + i);
printf("������ ������ �Է��ϼ���: ");
scanf("%d", &n);
double* b;
b = (double*)malloc((int64_t)sizeof(double) * (int64_t)(n + 1));
printf("������ ����� ������� �ְ����ױ��� ������� �Է��ϼ���: ");
for (int i = 0; i <= n; i++)scanf("%lf", b + i);
printf("���ø� �ֱ� T�� �Է��ϼ���: ");
double T; scanf("%lf", &T);
double** timedomain;
timedomain = (double**)malloc((int64_t)sizeof(double*) * (int64_t)2);
timedomain[0] = (double*)malloc((int64_t)sizeof(double) * (int64_t)(m + 1));
timedomain[1] = (double*)malloc((int64_t)sizeof(double) * (int64_t)(m + 1));
blt(m, n, a, b, T, timedomain);
printf("\nTime Domain Difference Equation\n\n");
printf("����(�ְ�������): ");
for (int i = 0; i <= m; i++)printf("%f ", timedomain[0][i]);
printf("\n");
printf("�и�(�ְ�������): ");
for (int i = 0; i <= m; i++)printf("%f ", timedomain[1][i]);
printf("\n\n");
free(a);
free(b);
free(timedomain[0]);
free(timedomain[1]);
free(timedomain);
return 0;
}