Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. FILE *f, *g;
  7. f = fopen("input.in", "rt");
  8. g = fopen("output.out", "wt");
  9. fseek(f, 0, SEEK_END);
  10. long long sfarsit = ftell(f);
  11. fseek(f, 0, SEEK_SET);
  12. long long curent = ftell(f);
  13. char c;
  14. int ghilimele = 0;
  15. while (curent != sfarsit) {
  16. fscanf(f, "%c", &c);
  17. if (c == '"') {
  18. fprintf(g, "%c", c);
  19. if (ghilimele == 0) {
  20. ghilimele = 1;
  21. } else {
  22. ghilimele = 0;
  23. }
  24. } else {
  25. if (c == '/') {
  26. char d;
  27. fscanf(f, "%c", &d);
  28. if (d == '/') {
  29. if (ghilimele == 0) {
  30. while (c != '\n') {
  31. fscanf(f, "%c", &c);
  32. }
  33. fprintf(g, "\n");
  34. } else {
  35. fprintf(g, "/%c", d);
  36. }
  37. } else {
  38. fprintf(g, "/%c", d);
  39. }
  40. } else {
  41. fprintf(g, "%c", c);
  42. }
  43. }
  44. curent = ftell(f);
  45. }
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement