Расположить столбцы заданной матрицы G1 в порядке убывания значений их минимальных элементов. Преобразованную матрицу напечатать
Вот замучился я... значит, приведеный ниже код компилится на VS 2003 и VS2006, а на моей 2005 ругается:
Код:
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <time.h>
using std::cout;
using std::cin;
int main()
{
int SZ=10;
srand(time(0));
double A[10][10], buf;
int i,j, min;
//zapolnim masiv
for( i=0;i<SZ;i++)
{
for(j=0;j<SZ;j++)
{
A[i][j]=(1+rand()%99)*(pow((-1),rand()));
//cout << A[i][j]<<"\t";
}
//cout << "\n";
}
//otsarteruem massiv
for (int p=0;p<SZ;p++)
{
for(i=0;i<SZ;i++)
{
min=i;
for(j=i+1;j<SZ;j++)
if(A[p][j]<A[p][min]) min=j;
buf=A[p][i];
A[p][i]=A[p][min];
A[p][min]=buf;
}
}
//vivod massiva
for(int p=0;p<SZ;p++)
{
for(int z=0;z<SZ;z++)
{
cout << A[z][p]<<"\t";
}
cout << "\n";
}
cout << "\n\n\n";
cin.get();
return 0;
}
c:\documents and settings\alexey\мои документы\visual studio 2005\projects\projectxxxx\projectxxxx\projectxxxx1 23.cpp(19) : error C2668: 'pow' : ambiguous call to overloaded function
c:\program files\microsoft visual studio 8\vc\include\math.h(575): could be 'long double pow(long double,int)'
c:\program files\microsoft visual studio 8\vc\include\math.h(527): or 'float pow(float,int)'
c:\program files\microsoft visual studio 8\vc\include\math.h(489): or 'double pow(double,int)'
while trying to match the argument list '(int, int)'
Помогите плиз, кто знает в чем "собака порылась". Буду мегаблагодарен.
Социальные закладки