| ||||||||||
| 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 | |||||||||
谁帮我看看哪里错了。。老wa~~~#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int N; //组数
int a[21][6]={0};
int i,j;
ifstream cin("1658.txt");
cin>>N;
for(i=0;i<N;i++)
{
for(j=0;j<4;j++)
{
cin>>a[i][j];
}
if(((a[1]-a[0])==(a[2]-a[1]))&&((a[3]-a[2])==(a[2]-a[1])))
a[i][4]=2*a[i][3]-a[i][2];
else
a[i][4]=a[i][3]*((float)a[i][3]/a[i][2]);
}
for(i=0;i<N;i++)
{
for(j=0;j<5;j++)
{
cout<<a[i][j];
if(j<4) cout<<" ";
}
cout<<endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator