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> | |
int main () { | |
int i, j, tamanho_vetor = 5, tamanho_string = 30; | |
int *vetor; | |
int **matriz; | |
char *string = "LINGUAGEM DE PROGRAMACAO"; | |
vetor = (int *)malloc(tamanho_vetor * sizeof(int)); |
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
class OCR : | |
contains_set = { | |
(0, 1) : set([0, 2, 3, 5, 6, 7, 8, 9]), | |
(1, 0) : set([0, 4, 5, 6, 8, 9]), | |
(1, 1) : set([2, 3, 4, 5, 6, 8, 9]), | |
(1, 2) : set([0, 1, 2, 3, 4, 7, 8, 9]), | |
(2, 0) : set([0, 2, 6, 8]), | |
(2, 1) : set([0, 2, 3, 5, 6, 8, 9]), | |
(2, 2) : set([0, 1, 3, 4, 5, 6, 7, 8, 9]) |
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
from flask import Flask, request, render_template | |
from flaskext import wtf | |
from wtforms.ext.appengine.db import model_form | |
from google.appengine.ext import db | |
app = Flask(__name__) | |
class Pessoa(db.Model): | |
nome = db.StringProperty(required=True) |
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
#coding:utf-8 | |
"""Implementação do exercício de composição do livro Aprenda Computação com Python. | |
Enunciado disponível em: http://www.franciscosouza.com.br/aprendacompy/capitulo_05.html#composicao | |
""" | |
def coeficienteAngular(x1, y1, x2, y2): | |
return float(y2 - y1) / (x2 - x1) | |
def cortaY(x1, y1, x2, y2): |
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
class Lcd | |
def gera_display(numero) | |
array = [] | |
numero.to_s.each_char do |num| | |
array << self.gera_matriz(num.to_i) | |
end | |
retorno = "\n" | |
3.times do |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
#include <stdio.h> | |
#include <stdlib.h> | |
int parImpar(int numero) | |
{ | |
if (numero%2==0) | |
return 1; | |
else | |
return 0; | |
} |
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
/*Faça um programa que receba três notas, calcule e mostre a | |
média aritmética entre elas.*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
/** | |
* Função responsável por calcular a média. | |
* | |
* Recebe um vetor com todas as notas e a quantidade de notas presentes nesse vetor. |
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> | |
struct Pessoa //registro que representa uma pessoa | |
{ | |
char nome[100]; | |
char raca[30]; | |
int idade; | |
char opcao_sexual[30]; | |
float altura; |
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 n, k; | |
int limite = 1; | |
int v[1000], subconjunto[1000]; | |
int i, j, l, contador_subconjunto, soma; | |
int encontrou = 0; |
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 n, k; | |
int limite = 1; | |
int v[1000], subconjunto[1000]; | |
int i, j, l, contador_subconjunto, soma; | |
int encontrou = 0; |