Показать сообщение отдельно
Старый 29.08.2010, 11:23      #1
gpo8ocek
Новичок
По умолчанию Решение проблем в программировании

Код:
#include <stdio.h>
#include <math.h>
#include <algorithm>

using namespace std;

struct coord {
	double x, y;
};

struct point {
	coord t;
	point *next;
};

coord a[100];

int main ()
{
	int n, i, j, maxn, minn;
	double min, max;

	freopen("input.txt", "rw", stdin);
	freopen("output.txt", "wt", stdout);

	scanf("%d", &n);
	scanf("%lf%lf", &a[0].x, &a[0].y);

	min = a[0].y;
	max = min;
	maxn = minn = 0;

	for (i = 1; i < n; i++) {
		scanf("%lf%lf", &a[i].x, &a[i].y);
		if (a[i].y > max) {
			max = a[i].y;
			maxn = i;
		}
		if (a[i].y < min) {
			min = a[i].y;
			minn = i;
		}
	}

	point.t = a[maxn];

}
На строчке
<<point.t = a[maxn];>>
вылетает
<<error C2143: синтаксическая ошибка: отсутствие ";" перед ".">>
причём, 2 раза.
gpo8ocek вне форума   Ответить с цитированием Вверх