Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE *f, *g;
- f = fopen("input.in", "rt");
- g = fopen("output.out", "wt");
- fseek(f, 0, SEEK_END);
- long long sfarsit = ftell(f);
- fseek(f, 0, SEEK_SET);
- long long curent = ftell(f);
- char c;
- int ghilimele = 0;
- while (curent != sfarsit) {
- fscanf(f, "%c", &c);
- if (c == '"') {
- fprintf(g, "%c", c);
- if (ghilimele == 0) {
- ghilimele = 1;
- } else {
- ghilimele = 0;
- }
- } else {
- if (c == '/') {
- char d;
- fscanf(f, "%c", &d);
- if (d == '/') {
- if (ghilimele == 0) {
- while (c != '\n') {
- fscanf(f, "%c", &c);
- }
- fprintf(g, "\n");
- } else {
- fprintf(g, "/%c", d);
- }
- } else {
- fprintf(g, "/%c", d);
- }
- } else {
- fprintf(g, "%c", c);
- }
- }
- curent = ftell(f);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement