Escolar Documentos
Profissional Documentos
Cultura Documentos
h>
#pragma hdrstop
#include <iostream>
#include <stdio.h>
#include<fstream.h>
#include <stdlib.h>
#include <math.h>
#include <Printers.hpp>
#include <algorithm>
#define PI 3.14159265358979;
#include "Looping.h"
//--------------------------------------------------------------------------#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//--------------------------------------------------------------------------__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
{
fscanf(in,"%*s\n");
n=n+1;
}
fclose (in);
int A[100],B[100],C[100],D[100];
in = fopen(FileInput,"r");
for(x=1;x<=n;x++)
{
fscanf(in,"%d,%d,%d\n",&A[x],&B[x],&C[x]);
}
fclose (in);
for(x=1;x<=n;x++)
{ D[x]=A[x]+B[x]+C[x];}
//Save file final ************************************
char OutputFile[200];
FILE *out;
strcpy(OutputFile,EdOutput->Text.c_str());
out= fopen(OutputFile,"w");
{
for(x=1;x<=n;x++)
{
fprintf(out,"%d,%d,%d,%d\n",A[x],B[x],C[x],D[x]);//Hasil
}
}
fclose(out);
}
//---------------------------------------------------------------------------