Ещё одна блок схема

Модераторы: Hawk, Romeo, Absurd, DeeJayC, WinMain

Ответить
Chellios
Сообщения: 1
Зарегистрирован: 13 дек 2009, 18:51

Я студент, только начал изучать С++. Не могу никак удружиться с Блог-схемами. Программы пишу легко, а изобразить не могу( Помогите плиз построить блок-схему. Завтра сдавать.....(СРОЧНО) Заранее спасибо)

Код: Выделить всё

#include<iostream>
#include<stdlib.h>
#include<fstream>
#include<iomanip>
#include<cmath>
using namespace std;

int main()
{
	double **A;
	double*B;
	double S=0;
	int a,b;
	double c;
	double min=1000;
	cout.precision(0);
	cout.setf(ios::fixed);
	cout.setf(ios::left);
	ifstream input;
	input.open("input.txt");
	input.precision(1);
	if(!input.is_open())
	{
		cout<<"Error no file"<<endl;
		exit(1);
	}
	input>>a;
	input>>b;
	const int n=a;
	const int m=b;

	A=new double *[n];
	for(int l=0; l<n; l++) A[l]=new double [m];
	B=new double [n];

	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			input>>c;
			A[i][j]=c;
		}
		//input>>endl;
	}
	input.close();
	ofstream output;
	output.precision(1);
	output.open("output.txt");
    if(!output.is_open()){cout<<"Error no file";exit(1);}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			cout<<A[i][j]<<' ';
			output<<A[i][j];
			if(A[i][j]<min) min=A[i][j];
		}
		B[i]=min;
		cout<<endl;
		output<<endl;
		min=1000;
	}
	for(int i=0;i<n;i++)
	{
		output<<"B="<<B[i]<<' ';
	}
	output<<endl;
	for(int j=0;j<4;j++)
	{
		S+=(A[4][j]-5)/A[3][j];
	}
	output<<"S="<<S<<endl;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			if(A[i][j]==A[4][4]) A[i][j]=S;
			output<<A[i][j]<<" ";
		}
		output<<endl;
	}
	output.close();
	return 0;
}
Ответить