#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIZE 100

int read_text(char str[], int size, int flag);

struct City
{
	char name[50];
	char cntry[50];
	int pop;
};

int main()
{
	char cntry[50];
	int i, pop, found;
	struct City city[SIZE];

	for(i = 0; i < SIZE; i++)
	{
		printf("\nCity: ");
		read_text(city[i].name, sizeof(city[i].name), 1);

		printf("Country: ");
		read_text(city[i].cntry, sizeof(city[i].cntry), 1);

		printf("Population: ");
		scanf("%d", &city[i].pop);

		getchar();
	}
	printf("\nEnter country to search: ");
	read_text(cntry, sizeof(cntry), 1);

	printf("Population: ");
	scanf("%d", &pop);

	found = 0;
	for(i = 0; i < SIZE; i++)
	{
		if((strcmp(city[i].cntry, cntry) == 0) && (city[i].pop > pop))
		{
			found = 1;
			printf("C: %s P: %d\n", city[i].name, city[i].pop);
		}
	}
	if(found == 0)
		printf("\nNone city is found\n");
	return 0;
}

