Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
14
Добавлен:
17.04.2015
Размер:
999 б
Скачать
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "func06.h"

#define N 10

int main()
{

	float* array;
	float summ = 0;
	int i,imax,first,sec;
	array = new float[N];
	for(i = 0;i < N;i++)
	{
		printf("Vvedite %d chislo: ",i);
		scanf("%f",&array[i]);
	}	

	printf("==============================\n");
	for (i = 0;i < N;i++)
		printf("%f\n",array[i]);

	imax = findmax(array,N);
	printf("Index of max element is %d; max element = %f\n",imax,array[imax]);
	
	first = findfirstplus(array,N);
	printf("index of first plus element is %d; first plus element = %f\n",first,array[first]);

	sec = findsecplus(array,first,N);
	printf("index of second plus element is %d; second plus element = %f\n",sec,array[sec]);


	for (i = first + 1;i < sec;i++)
		summ += array[i];
	printf("summ = %f\n",summ);

	sort(array,N);

	printf("==============================\n");
	for (i = 0;i < N;i++)
		printf("%f\n",array[i]);
	system("pause");
	return 0;
}
Соседние файлы в папке Лабораторные