| ||||||||||
| 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 | |||||||||
1922我的1922总是超时,谁帮我看看`
#include <iostream>
#include <ctime>
#define N 18
using namespace std;
int main()
{
for(;;)
{
double _array[N][2],t_temp[N],temp = 1000;
int n,k,flag;
do
cin >> n;
while(n == 0);
register int i;
for(i = 0;i < n;i++)
{
for(k = 0;k != 2;k++)
{
cin >> _array[i][k];
if(_array[i][1] < 0 && _array[i][1] > -60000)
{
n -= 1;
k = -1;
_array[i][1] = 0;
}
}
_array[i][0] /= 3600;
t_temp[i] = 4.5 / _array[i][0] + _array[i][1];
if(t_temp[i] < temp)
{
flag = i;
temp = t_temp[i];
}
}//输入 VI TI
/*~~~~~~~~~~~~~对double TI 处理~~~~~~~~*/
if((t_temp[flag] - (int)t_temp[flag]) != 0)
t_temp[flag] = (int)t_temp[flag] + 1;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
cout << t_temp[flag] << endl;
}
system("pause");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator