Скачиваний:
7
Добавлен:
02.05.2014
Размер:
1.24 Кб
Скачать
//---------------------------------------------------------------------------

#include <vcl.h>
#include <stdio.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
GV gv;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    LoadFile("input.txt");
    SVD *sevidge;
    sevidge = new SVD(gv.matrix, gv.row);
    sevidge->DrawPoint(Series1,gv.matrix,gv.row);
    sevidge->DrawRectangle(Series2,Series3,Series4,Series5,gv.matrix,gv.row);
    Label2->Caption = sevidge->index + 1;
    Label4->Caption = gv.matrix[sevidge->index][0];
    Label6->Caption = gv.matrix[sevidge->index][1];
}
//---------------------------------------------------------------------------
int TForm1::LoadFile(String filename)
{
    FILE *input;
    int temp=0;
    int i=0,j=0;
    input = fopen(filename.c_str(),"r");
    while(!feof(input))
    {
        fscanf(input,"%d",&temp);
        gv.matrix[i][j] = temp;
        if(j==0) j=1;
        else { j=0; i++;}
    }
    gv.row = i;

}





Соседние файлы в папке Лабораторная работа №6 - Программа