Add FramaC TDM
This commit is contained in:
parent
713e8d12c4
commit
56e86b4b20
9 changed files with 606 additions and 0 deletions
15
content/conception_formelle/99-DM_framac/code/abs.c
Normal file
15
content/conception_formelle/99-DM_framac/code/abs.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "abs.h"
|
||||
|
||||
int abs(int n)
|
||||
{
|
||||
int res = n;
|
||||
if (n < 0)
|
||||
res = -n;
|
||||
return res;
|
||||
}
|
||||
|
||||
int abs2(int n)
|
||||
{
|
||||
int aux = n % 2 + (n + 1) % 2;
|
||||
return n * aux;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue