The Sixth, Seventh and Eighth tasks are done
This commit is contained in:
parent
a6c451d866
commit
5a81ed3cd8
41 changed files with 1562 additions and 5 deletions
30
2025.03.07/6Ex/init_f.c
Normal file
30
2025.03.07/6Ex/init_f.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include "init_f.h"
|
||||
#include <math.h>
|
||||
|
||||
#define MAX(n, m) (n < m ? m : n)
|
||||
|
||||
double f1(int n, int m, int i, int j)
|
||||
{
|
||||
return MAX(n, m) - MAX(i, j) + 1;
|
||||
}
|
||||
|
||||
double f2(int n, int m, int i, int j)
|
||||
{
|
||||
(void)n;
|
||||
(void)m;
|
||||
return MAX(i, j);
|
||||
}
|
||||
|
||||
double f3(int n, int m, int i, int j)
|
||||
{
|
||||
(void)n;
|
||||
(void)m;
|
||||
return abs(i - j);
|
||||
}
|
||||
|
||||
double f4(int n, int m, int i, int j)
|
||||
{
|
||||
(void)n;
|
||||
(void)m;
|
||||
return 1./(i+j-1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue