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> | |
int fibonacci (int t1, int t2, int n) { | |
if (n == 1) { | |
return t1; | |
} else if (n == 2) { | |
return t2; | |
} else { | |
return fibonacci(t1, t2, n-1) + fibonacci(t1, t2, n-2); | |
} |
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 <math.h> | |
int main(){ | |
double n; | |
int num, den=1; | |
int i; | |
scanf("%lf", &n); |
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
//URI 2164 | |
#include <stdio.h> | |
#include <math.h> | |
int main(){ | |
double n, fib; | |
scanf("%lf", &n); |
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> | |
int main(){ | |
int m, n, i, j, cont=0; | |
scanf("%d %d", &m, &n); | |
int mat[m][n]; |
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
//Código explicado em https://bunkerdeprogramacao.blogspot.com | |
#include <stdio.h> | |
int main(){ | |
int v[6]={2, 5, 10, 20, 50, 100}; | |
int i, j, val, pag=1, dif=1, cont=0; | |
while(val!=0 && pag!=0){ |
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> | |
int main(){ | |
int n, m, *pedras, p, d, i; | |
scanf("%d %d", &n, &m); | |
pedras=(int *) malloc(n * sizeof(int)); |
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> | |
int main(){ | |
int n, num, inv=0, aux; | |
scanf("%d", &n); | |
while(n>0){ | |
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> | |
int main(){ | |
int n, p, q, juncao; | |
char C; | |
scanf("%d", &n); | |
scanf("%d %c %d", &p, &C, &q); |
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> | |
int main(){ | |
int a, b, i, j=100, va[3], vb[3]; | |
scanf("%d %d", &a, &b); | |
for(i=0;i<3;i++){ | |
va[i]=a%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
#include <stdio.h> | |
int main(){ | |
int ano, cometa=1986; | |
scanf("%d", &ano); | |
while(cometa<ano && cometa!=ano){ | |
cometa=cometa+76; |
NewerOlder