Cod sursa(job #1349678)

Utilizator achirialexAlexandru Achiritoaei achirialex Data 20 februarie 2015 13:16:57
Problema Convertor Scor 0
Compilator c Status done
Runda rosedu_cdl_2015 Marime 0.58 kb
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int main(void){
	freopen("convertor.in", "r", stdin);
	freopen("convertor.out", "w", stdout);
	int cap = 1024;
	int cont = 0;
	char text[1024 * 10128];
	char buffer[1024];
	while(gets(buffer)){
//		cont = cont + strlen(buffer) + 1;
//		if(cont >= cap){
//			cap  = cap * 2;
//			text = (char*)realloc(text, cap * sizeof(char));
//		}
		strcat(text, buffer);
	}
	char *token;
	token = strtok(text, "}");
	while(token != NULL){
		printf("%s\n", token);
		token = strtok(0, "}");
	}
//	printf("%s", text);
	return 0;
}