This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeOperators #-} | |
-- | This type class describes operations that can be performed over Servant | |
-- API trees. The instances essentially distribute the actions over the ':<|>' | |
-- constructor, and apply them to the leaves of the API trees: functions or | |
-- values in an applicative functor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct PONTO { | |
float x, y; | |
} PONTO; | |
void atribuiValorPonto(PONTO* p, float a, float b) { | |
p->x = a; | |
p->y = b; | |
} | |
float dist(PONTO* p1, PONTO* p2) { | |
return sqrt(pow(p1.x - p2.x, 2) - pow(p1.y - p2.y, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#define SIZE 3 | |
float media_matriz(int n, float a[][SIZE]) { | |
float m = 0.0f; | |
size_t i; | |
for(i = 0; i < n*SIZE; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* sudoku.c | |
* @author Arthur Xavier <arthur.xavierx@gmail.com> | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
int main() { | |
size_t i, j; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** dfs.c | |
* @author Arthur Xavier <arthur.xavierx@gmail.com> | |
* @usage | |
* $ gcc dfs.c | |
* $ ./a.out < maze1.txt | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
/** |