Skip to content

Instantly share code, notes, and snippets.

View philorocha's full-sized avatar

Felipe Vieira da Rocha philorocha

  • São Lourenço da Mata, Pernambuco, Brazil
View GitHub Profile
import { StyleSheet, Text, View, Platform, ScrollView } from 'react-native';
import { Icon, Image, ListItem, Avatar, Header, Button } from 'react-native-elements';
import { useEffect, useState } from 'react';
import { useIsFocused } from '@react-navigation/native';
import { getValueFor } from '../token/token';
import axios from 'axios';
export default function DisplayLojaView({ navigation, route }) {
const { idLoja } = route.params;
const [token, setToken] = useState('');
/*Implementação de lista dinâmica*/
#include <stdio.h>
#include <stdlib.h>
typedef struct No{
int valor;
struct No* proximo;
} No;
No* adicionar(No* no, int valor) {
/*Fila dinamica funcional*/
#include <stdio.h>
#include <stdlib.h>
typedef struct No{
int valor;
struct No* proximo;
} No;
No* inserir(No* no, int valor) {
#include <stdio.h>
#include <stdlib.h>
typedef struct No {
int valor;
struct No* proximo;
} No;
No* pilha = NULL;
#include <stdio.h>
int push(int vetor[], int valor, int* topo, int tamanho) {
(*topo)++;
if (*topo < tamanho) {
vetor[*topo] = valor;
return 1;
} else {
return 0;
}
<?php
/* Recebendo dados do formulário. Existe um modo mais seguro, mas pra abstrair deixei o modo simples */
$codigo = $_POST['codigo'];
$nome = $_POST['nome'];
$email = $_POST['email'];
$data_nasc = $_POST['data_nasc'];
if (codigo_existe($codigo)) {
echo 'Já existe um cliente com este codigo!<br/>';
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Cadastro de Usuário</title>
</head>
<body>
<form action="adicionar_usuario.php" method="post">
#include <stdio.h>
int fatorial(int num) {
if (num == 0 || num == 1) {
return 1;
}
if (num > 1) {
return num * fatorial(num - 1);
}
}
#include <stdio.h>
/*Dado um vetor, calcule o produto de todos os elementos do vetor*/
int produto(int vetor[], int tamanho) {
if (tamanho > 0) {
return vetor[tamanho - 1] * produto(vetor, tamanho - 1);
}
return 1;
}
#include <stdio.h>
int fibonacci(int n) {
if (n == 1) {
return 1;
}
if (n == 2) {
return 1;
}
return fibonacci(n - 1) + fibonacci(n - 2);