Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

谁帮我看看,为什么 RE?

Posted by wplxb at 2007-06-12 21:10:12 on Problem 2215
#include <stdio.h>

#define MAX_ROW 1000
#define MAX_COLUMN 1000

int main(int argc, char * argv[])
{
    int case_num;
    int case_count;
    int seat[MAX_ROW][MAX_COLUMN];

    if (EOF == scanf("%d", &case_num))
    {
        return 1;
    }

    for (case_count = 0; case_count < case_num; ++case_count)
    {
        int i;
        int j;
        int row;
        int column;
        int r1;
        int s1;
        int r2;
        int s2;
        int query_count;
        int query_num;
        int score;

        scanf("%d %d", &row, &column);

        for (i = 0; i < row; ++i)
        {
            for (j = 0; j < column; ++j)
            {
                scanf("%d", &seat[i][j]);
            }
        }

        scanf("%d", &query_num);

        for (query_count = 0; query_count < query_num; ++query_count)
        {
            scanf("%d %d %d %d", &r1, &s1, &r2, &s2);

            score = 0;
            for (i = r1 - 1; i < r2; ++i)
            {
                for (j = s1 - 1; j < s2; ++j)
                {
                    score += seat[i][j];
                }
            }

            printf("Absolutni hodnota pohodlnosti je %d bodu.\n", score);
        }

        printf("\n");
    }

    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator