求助:编写了一个小程序,逐字逐过程运行是正确的,直接运行结果就出错了
各位大侠看下,我编写的是一个根据已知时间序列重构出一个数组。
时间序列短的时候能用,时间序列长的时候输出的数组顺序就乱了,逐字逐句运行时也是正确的,找不到什么原因了,我也是新手,请大家帮忙看下:
#include<iostream>
#include<iomanip>
using namespace std;
void main()
{
int m=8,t=2,i,j;
double Y[2986][8];
double x[3000]={90.5458998100000,81.3176428000000,80.7884237600000,79.7961380600000,79.9284428200000,81.4499475600000,81.4499475600000,79.8622904400000,75.7939190700000,76.5546714400000,73.1147476800000,74.1070333800000,73.1478238700000,69.8732810600000,66.2018239700000,63.6218811500000,63.8864906700000,62.6295954500000,66.8302715800000,65.1103097000000,63.1588144900000,61.8688430800000,62.2326811700000,61.5380811800000,64.0518716200000,63.7541859100000,59.4873574000000,58.8258336000000,58.3958431300000,57.0397193400000,59.7519669200000,61.4719288000000,60.6781002400000,58.3958431300000,59.6858145400000,58.4289193200000,59.2227478800000,60.9096335700000,58.9581383600000,56.6097288700000,55.0551479400000,55.7497479300000,53.9967098600000,57.6681669500000,69.9063572500000,67.8225572800000,67.1279572900000,66.4995096800000,68.9802239300000,66.2018239700000,63.7541859100000,61.6373097500000,62.1003764100000,60.4134907200000,63.4895763900000,62.4311383100000,58.5943002700000,57.8004717100000,55.7166717400000,56.0805098300000,57.7673955200000,58.3627669400000,56.2128145900000,53.5336432000000,55.2205288900000,53.4013384400000,55.1213003200000,57.0066431500000,55.3528336500000,53.5997955800000,52.7728908300000,52.9713479700000,53.2359574900000,57.2051002900000,57.1389479100000,57.0397193400000,57.5027860000000,59.5535097800000,59.7850431100000,63.5888049600000,64.0518716200000,61.0750145200000,63.0595859200000,63.2911192500000,65.0441573200000,68.2194715600000,70.3694239100000,68.3517763200000,66.9625763400000,69.6086715400000,68.7486906000000,72.3870715000000,73.0816714900000,71.9901572200000,70.0717382000000,69.4432905900000,146.246203770000,196.092022100000,251.891554630000,81.4168713700000,105.132499600000,96.7972997200000,97.2272901900000,95.5073283100000,99.1457092100000,97.2272901900000,92.1335569300000,89.9836045800000,85.9152332100000,85.4521665500000,84.6252618000000,83.9637380000000,80.1268999600000,76.4885190600000,77.8115666600000,73.7101191000000,75.6946905000000,74.9008619400000,72.8501381600000,69.8732810600000,67.9879382300000,68.4179287000000,68.4510048900000,72.1555381700000,70.4025001000000,68.2525477500000,66.9295001500000,67.4917953800000,66.1687477800000,69.7740524900000};
for(i=0;i<2986;i++)
{
for(j=0;j<8;j++)
{
Y[i][j]=x[i+j*t];
cout<<setw(10)<<Y[i][j];
}
cout<<endl;
}
}
中间是3000个时间序列,就是一组数字,由于篇幅有限就省略了