Cod sursa(job #1349129)
| Utilizator | Data | 19 februarie 2015 23:58:18 | |
|---|---|---|---|
| Problema | Convertor | Scor | 0 |
| Compilator | c | Status | done |
| Runda | rosedu_cdl_2015 | Marime | 0.51 kb |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(void){
FILE *fin = fopen("convertor.in", "r");
char linie[1024];
int lungime, counting;
lungime = 0;
counting = 0;
char aux;
int i;
while((aux = fgetc(fin)) != EOF){
if(aux == '{'){
lungime = 0;
counting = 1;
}
if(aux != '\n' && counting == 1){
linie[lungime] = aux;
lungime++;
}
if(aux == '}' && counting == 1){
counting = 0;
printf("%s\n", linie);
memset(linie, '\0', 1024);
}
}
return 0;
}
