Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void main() {
- int n, m=0, i, j, k=0;
- scanf("%d", &n);
- float a, b, *vetor=malloc(n*sizeof(float)), *aux=malloc(n*sizeof(float));
- for (i=0; i<n; i++)
- scanf("%f", &vetor[i]);
- for (i=0; i<n; i++)
- {
- for (j=i+1; j<n; j++)
- if (vetor[i] == vetor[j])
- m++;
- if (m == 0)
- {
- aux[k]=vetor[i];
- k++;
- }
- m=0;
- }
- for (i=k-1; i>=0; i--)
- printf("%f\t", aux[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement