Cod sursa(job #1349185)

Utilizator achirialexAlexandru Achiritoaei achirialex Data 20 februarie 2015 00:27:44
Problema Convertor Scor 0
Compilator cpp Status done
Runda rosedu_cdl_2015 Marime 1.01 kb
//============================================================================
// Name        : ConvertorCPP.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main() {
	ifstream fin;
	ofstream fout;
	fin.open("convertor.in");
	fout.open("convertor.out");
	char linie[2048];
	int lungime, counting;
	char aux;
	lungime = 0;
	counting = 0;
	int i;
	fin.get(aux);//aux = getchar();
	while(!fin.eof()){//aux != EOF){
		if(aux == '{' && counting == 0){
			lungime = 0;
			counting = 1;
		}
		if(aux != '\n' && counting == 1){
			linie[lungime] = aux;
			lungime++;
		}
		if(aux =='}' && counting == 1){
			counting = 0;
			cout<<linie<<endl;
			for(i = 0; i < 2048; i++)
				linie[i] = '\0';
		}
		fin.get(aux);//aux = fin.getchar();

	}
	//cout<<"mere";
	fin.close();
	fout.close();
	return 0;
}