fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i,j;
  6. char str[1000];
  7.  
  8. scanf("%s",str); // input the string
  9. for (i = 0; str[i] != '\0'; i++)
  10. {
  11. for (j = i + 1; str[j] != '\0'; j++)
  12. {
  13. if (str[i] == str[j]) // compare
  14. {
  15. printf("%c", str[i]);
  16. return 0;
  17. }
  18. }
  19. }
  20. }
Success #stdin #stdout 0.01s 5340KB
stdin
Standard input is empty
stdout
Standard output is empty