bnuoj3013--Ancient Keyboard

bnuoj3013--Ancient Keyboard
http://www.bnuoj.com/bnuoj/contest_show.php?cid=926#problem/9911
对模拟题不太感冒,这道题搞了好久,感谢小焦~~
网选在即,一周的加强训练马上就要过去了,着急啊,着急啊!!

#include<stdio.h>
#include
<stdlib.h>
#define LEN 
typedef 
struct
{
    
char c;
    
int a, b;
}
Node;
int main()
{
    
int i, j;
    
int T, n;
    Node nd[
1000];
    
int min = 0xfffffff;
    
int max = -1;
    scanf(
"%d"&T);
    
while(T--)
    
{
        scanf(
"%d"&n);
        
for(i = 0; i < n; i++)
        
{
            getchar();
            scanf(
"%c%d%d"&nd[i].c, &nd[i].a, &nd[i].b);
            
if(nd[i].a < min)
                min 
= nd[i].a;
            
if(nd[i].b > max)
                max 
= nd[i].b;
        }

        
int count = 0;
        
for(i = min; i <= max; i++)
        
{
            
for(j = 0; j < n; j++)
            
{
                
if(nd[j].a == i)
                    count
++;
                
if(nd[j].b == i)
                    count
--;
            }

            
if(count)
                printf(
"%c", count + 'A' - 1);
        }

        printf(
"\n");
    }

    
//system("pause");
}


你可能感兴趣的:(bnuoj3013--Ancient Keyboard)