// N1 判断素数
#include<stdio.h>
#include<math.h>
int main()
{
int n;
int i;
while (~scanf("%d",&n))
{
for ( i = 2; i <= sqrt((double)n); i++)
{
if (n%i==0)
{
break;
}
}
//一直没有找到因子
if (i>sqrt((double)n))
{
printf("yes");
}
else
{
printf("no");
}
}
return 0;
}
//N2:暴力计算二维平面中最近的两个点
//2.在一个二维平面内有n个点,每个点坐标为(x,y),求最近的两个点的距离。(暴力求解)
/*输入:
5
1 2
100 200
1000 2000
1000 1
1 3
*/
//暴力求解思路:将每个点都存储在结构体数组中,计算出任意两个点之间的距离放在距离数组中,再遍历距离数组求出最小的距离。
#include<stdio.h>
#include<math.h>
#define N 1000
#define M 1000000
struct Point
{
double x;
double y;
};
Point p[N];
double dis[M];
// Calculate the distance of two points.
double distance(const struct Point *a, const struct Point *b)
{
return sqrt((a->x - b->x)*(a->x - b->x) + (a->y - b->y)*(a->y - b->y));
}
int main()
{
int n;
int i;
int j;
int k;
double min;
while (~scanf("%d",&n))
{
k = 0;
for (i = 0; i < n; i++)
{
scanf("%lf%lf", &p[i].x, &p[i].y);
}
for ( i = 0; i < n; j++)
{
for ( j = i+1; j < n-i-1; j++)
{
dis[k++] = distance(&p[i],&p[j]);
}
}
min = 0;
for ( i = 1; i < k; i++)
{
if (min>dis[i])
{
min = dis[i];
}
}
printf("%.2lf
", min);
}
return 0;
}