Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Questão 1
- /*int fibonacci (int* n[])
- {
- int x,y,a=0,b=1,c=0;
- scanf("%d", &x);
- malloc(sizeof(x * int))
- for (int i = 0; i < x; i++)
- {
- for(y=1; y<x; y++)
- {
- if(y%2==1)
- {
- n[i] = c;
- c=a+b;
- a=c;
- }
- else if(y==2)
- n[i] = c
- else if(y%2==0)
- {
- n[i] = c;
- c=a+b;
- b=c;
- }
- }
- }
- return n[]
- }
- */
- // Questão 2
- /*#include <stdio.h>
- #include <stdlib.h>
- int main (void)
- {
- long int x, y, i;
- double fx = 1, fn = 1, s;
- while (scanf("%ld %ld", &M, &N) != EOF)
- {
- for (i=x; i>=1; i--)
- fx *= i;
- for (i=y; i>=1; i--)
- fy *= i;
- s = fx + fy;
- printf ("%.0f\n", s);
- fx = fy = 1;
- }
- return 0;
- }*/
- // Questão 3
- /*#include <stdio.h>
- #include <math.h>
- int prime(int x)
- {
- int i, r;
- if(x<2)
- return 0;
- if(x==2)
- return 1;
- if(x%2==0)
- return 0;
- r=sqrt(x);
- for(i=3; i<=r; i=i+2)
- {
- if(x%i==0)
- return 0;
- }
- return 1;
- }
- int main()
- {
- int a,b,c;
- scanf("%d", &c);
- for(a=1;b<=c;b++)
- {
- scanf("%d", &a);
- if(1==prime(a))
- printf("%d - Primo\n", a);
- else if(0==prime(a))
- printf("%d - Nao Primo\n", a);
- }
- return 0;
- }
- */
- // Questão 4
- /*#include <stdio.h>
- int main()
- {
- int n,x;
- char cesar[50];
- scanf("%d",&n);
- for(int i = 0; i < n; i++)
- {
- scanf("%s",&cesar);
- scanf("%d",&x);
- for(int j = 0; j < 50; j++)
- {
- if(cesar[j] == '\0') break;
- if((cesar[j] - x) < 65) printf("%c", (cesar[j] - x)+ 26);
- else printf("%c", (cesar[j] - x));
- }
- }
- return 0;
- }*/
- // Questão 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement