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
/******************** | |
* Exemplo de cálculo matemático de divisão e multiplicação | |
* feito com soma e subtração. | |
* | |
* Por Luiz Felipe - https://github.com/Silva97 | |
********************/ | |
#include <stdio.h> | |
#define PRECISION 1000000 |
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
/******************** | |
* Desenvolvido por Luiz Felipe | |
* https://github.com/Silva97 | |
* | |
* Algoritmo feito em resolução de um desafio | |
* cujo o objetivo era apresentar o menor número | |
* de persistência indicada pelo usuário. | |
* | |
* Desafio no grupo Programação em C: | |
* - https://www.facebook.com/groups/414761988665865/permalink/1144414109033979/ |
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> | |
#define MAX_STACK 64 | |
typedef struct stack { | |
int value[MAX_STACK]; | |
int size; | |
} Stack; | |
void push(Stack *s, int value); |
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
/******************** | |
* Exemplo maluco por Luiz Felipe. | |
* | |
* https://github.com/Silva97 | |
********************/ | |
#include <stdio.h> | |
#define UCHARPTR (unsigned char *) |
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
function sum(...args){ | |
var result = 0; | |
if(args.length == 4){ | |
for(let i = 0; i < args.length; i++) | |
result += args[i]; | |
return result; | |
} else { | |
return function(...newArgs){ |
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> | |
int main(){ | |
int x, y; | |
scanf("%d", &x); | |
switch(x){ | |
case 1: y = 7; break; | |
case 2: y = 1; break; | |
case 3: y = 3; break; |
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> | |
#define tostr(...) #__VA_ARGS__ | |
#define type(x) _Generic(x, \ | |
int: "int", \ | |
unsigned int: "unsigned int", \ | |
short int: "short int", \ | |
int *: "int *", \ | |
char: "char", \ | |
char *: "char *", \ |
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 <string.h> | |
#include <stdlib.h> | |
struct test { | |
char str[10]; | |
int n; | |
}; | |
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 <iostream> | |
int operator +(int x, std::string str){ | |
return x + std::stoi(str, nullptr, 10); | |
} | |
int main(void) | |
{ | |
int x = 5; | |
std::string str = "13"; |
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
/******************** | |
* Resolução para o problema: https://www.urionlinejudge.com.br/judge/pt/problems/view/1026 | |
* Por Luiz Felipe - https://github.com/Silva97 | |
********************/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
char* utostr(char *str, unsigned int n); | |
char output[BUFSIZ]; |
OlderNewer