| ||||||||||
| 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 | |||||||||
Re:LRJ还出这种水题???In Reply To:LRJ还出这种水题??? Posted by:l3160732 at 2008-05-28 19:05:10 > 要是1000啥的还差不多。
#include <stdio.h>
int des[100][100],i,j,n,x,y,L;
char s[10];
int main()
{
for(i = 0;i < 100;i++)
for (j = 0;j < 100;j++)
des[i][j] == 0;
scanf("%d",&n);
while (n-- >0)
{
scanf("%s %d %d %d",s,&x,&y,&L);
if (s[0] == 'B')
for (i = x;i<x+L;i++)
for (j = y;j <y+L;j++)
des[i][j] = 1;
if (s[0] == 'W')
for (i = x;i<x+L;i++)
for (j = y;j <y+L;j++)
des[i][j] = 0;
if (s[0] == 'T')
{
int count = 0;
for (i = x;i<x+L;i++)
for (j = y;j <y+L;j++)
if (des[i][j] == 1)
count++;
printf("%d\n",count);
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator