Jak już @Oscar, napisał
Dwie pętle są niepotrzebne, tak samo tablica. Nie ma warunku, że trzeba pamiętać w jakimś celu parametry tych kół. Policzyć je i te z pierwszej ćwiartki można jednocześnie.
dodam jeszcze, można się "obejść" bez struktury Kolo, Moja propozycja zmian
#include <stdio.h>
int main()
{
double x, y, r;
int counter_circle = 0;
int counter_circle_1st_qtr = 0;
char *first_qtr;
FILE *file_ = fopen("circles.txt", "r");
printf("\n | os x | os y | promien | I cwiartka |\n");
printf(" +--------+--------+---------+------------+\n");
if (file_ != NULL) {
while (fscanf(file_, "%lf,%lf,%lf", &x, &y, &r) > 0) {
counter_circle++;
if ((x>0 && y>0) && (r<=x && r<=y)) {
counter_circle_1st_qtr++;
first_qtr = "tak";
} else {
first_qtr = "nie";
}
printf("%2c %5.2lf %2c %5.2lf %2c %5.2lf %6c %s\n", 32, x, 32, y, 32, r, 32, first_qtr);
}
printf(" +--------+--------+---------+------------+\n");
printf("%4cIlosc kol: %d\n%4cIlosc w I cwiartce: %d\n", 32, counter_circle, 32, counter_circle_1st_qtr);
}
fclose(file_);
return 0;
}
circles.txt x,y,r
2,-3,4
2,3,2
3,1,3
-2,-3,2
4,5,2