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

那位大哥替我看一下,明明是对的啊?

Posted by zhangjb at 2005-02-19 00:04:23 on Problem 1658
#include <iostream>
#include <vector>
using namespace std;

void main()
{
    int n;  cin >> n;
    vector< vector<int> > homeworks(n, vector<int>(5));
    for (int i=0;i<n;i++)
    {
        for (int j=0;j<4;j++)
        {
            cin >> homeworks[i][j];
        }
    }
    for (i=0;i<n;i++)
    {
        if ( homeworks[i][3]-homeworks[i][2]==homeworks[i][2]-homeworks[i][1]==homeworks[i][1]-homeworks[i][0] )
            homeworks[i][4] = homeworks[i][3]+homeworks[i][3]-homeworks[i][2];
        else homeworks[i][4] = homeworks[i][3]/homeworks[i][2]*homeworks[i][3];
    }
    for (i=0;i<n;i++)
    {
        for (int j=0;j<5;j++)
        {
            cout << homeworks[i][j] << " ";
        }
        cout << endl;
    }
}


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