fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. using namespace std;
  4.  
  5. char *func(char*);
  6.  
  7. int main(){
  8.  
  9. char* input = "He&uf.jp";
  10.  
  11. char *out = "";
  12. out = func(input);
  13. printf("%s" , out);
  14.  
  15. }
  16.  
  17. #include<bits/stdc++.h>
  18.  
  19. char *func(char* in)
  20. {
  21. char *out = "";
  22.  
  23. int len = strlen(in);
  24. int i = 0;
  25.  
  26. int j = len - 1;
  27.  
  28. while(i<j)
  29. {
  30. if(!isalpha(in[i]))
  31. i++;
  32. if(!isalpha(in[j]))
  33. j--;
  34. else {
  35. swap(in[i] , in[j]);
  36. i++;
  37. j--;
  38. }
  39. }
  40.  
  41. strcpy(out,in);
  42. return out;
  43. }
Runtime error #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty