This file contains hidden or 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 <ctype.h> | |
main(void) { | |
char ch; | |
printf("Entre com algum texto (digite um ponto para sair).\n"); | |
do { | |
ch = getchar(); | |
This file contains hidden or 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
/* Mostra um relógio por software */ | |
#include <stdio.h> | |
#define DELAY 1280000 | |
struct my_time { | |
int hours; | |
int minutes; | |
int seconds; | |
}; |
This file contains hidden or 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> | |
#define MAX 100 | |
struct addr { | |
char name[30]; | |
char street[40]; | |
char city[20]; | |
char state[3]; |
This file contains hidden or 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> | |
/* Uma versão muito simples da função gets() | |
* da biblioteca padrão. */ | |
char *xgets(char *s) | |
{ | |
char ch, *p; | |
int t; | |
p = s; /* gets() devolve um ponteiro para s */ |
This file contains hidden or 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
/* Apresenta as potências dos números de 1 a 10. | |
* Nota: muito embora esse programa esteja correto | |
* alguns compiladores apresentarão uma mensagem de | |
* advertência com relação aos argumentos para as funções | |
* table() e show(). Se isso acontecer, ignore */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
int pwr(int a, int b); | |
void table(int p[40][10]); |
This file contains hidden or 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
/* Aloca espaço para uma string dinamicamente, solicita | |
* a entrada do usuário e, em seguida, imprime a string de | |
* trás para frente */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
main(void) | |
{ | |
char *s; |
This file contains hidden or 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> | |
char *p = "alo mundo"; | |
main(void) | |
{ | |
register int t; | |
/* imprime o conteúdo da string de trás para frente */ |
This file contains hidden or 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> | |
#define SIZE 50 | |
void push(int i); | |
int pop(void); | |
int *tos, *p1, stack[SIZE]; |
This file contains hidden or 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 100 | |
#define LEN 80 | |
char text[MAX][LEN]; | |
/* Um editor de texto muito simples */ | |
main(void) | |
{ |
This file contains hidden or 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
#!/usr/bin/env ruby -wKU | |
require "continuation" | |
def my_method | |
callcc { |continuation| puts "Dentro do callcc"; return continuation } | |
puts "De volta ao método" | |
end | |
number = 1 |