| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
求救,求救#include<stdio.h>
main()
{
long x,y,n,i,j,x0[100]={0},x1[100]={0},x2[100]={0},y0[100]={0},y1[100]={0},y2[100]={0},r[100]={0},temp;
scanf("%d%d",&x,&y);
scanf("%d",&n);
for (i=0;i<n;n++)
scanf("%d%d%d",&x0[i],&y0[i],&r[i]);
for (i=0;i<n;n++)
x1[i]=x0[i]-r[i];
x2[i]=x0[i]+r[i];
y1[i]=y0[i]-r[i];
y2[i]=y0[i]+r[i];
for (i=0;i<n;n++)
for (j=i+1;j<n;n++)
if (x1[i]>x1[j])
{
temp=x1[i];
x1[i]=x1[j];
x1[j]=temp;
}
if (x2[i]<x2[j])
{
temp=x2[i];
x2[i]=x2[j];
x2[j]=temp;
}
if (y1[i]>y1[j])
{
temp=y1[i];
y1[i]=y1[j];
y1[j]=temp;
}
if (y2[i]<y2[j])
{
temp=y2[i];
y2[i]=y2[j];
y2[j]=temp;
}
printf("%d",x*y-(x2[0]-x1[0])*(y2[0]-y1[0]));
getch();
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator