fork(1) download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. #include <malloc.h>
  4.  
  5. void main()
  6. {
  7. int i=0, j=0, find=0;
  8. int* arr=malloc(sizeof(int));
  9. while (find==0)
  10. {
  11. scanf("%d", &arr[i]);
  12. for (j=0;j<i;j++)
  13. {
  14. if (arr[i]==arr[j])
  15. {
  16. find=1;
  17. }
  18. }
  19. ++i;
  20. arr=(int *)realloc(arr, sizeof(int)*i);
  21. }
  22.  
  23. for (i, j=0; j<i; ++j)
  24. {
  25. printf("%d", arr[j]);
  26. }
  27. putchar('\n');
  28. }
  29.  
  30.  
  31.  
Runtime error #stdin #stdout 0s 2304KB
stdin
Standard input is empty
stdout
00