fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main() {
  6. char t[10];
  7. char r[10];
  8. fgets(t, 10, stdin);
  9. int c = 0;
  10. for (int i = 0; i < 10 && t[i] != 0; i++) {
  11. if (strchr("01234567890ip+-*/", t[i])) {
  12. r[c++] = t[i];
  13. }
  14. }
  15. r[c] = '\0';
  16. printf("%s", r);
  17. }
Success #stdin #stdout 0s 2172KB
stdin
3 5+2ia
stdout
35+2i