As a function of n , what is the flop count of the following
code,
s=0...
As a function of n , what is the flop count of the following
code,
s=0
for k=1:n ,
s=s-j-1
for j=k:n ,
s=s+k+j^2*(k-1)
end
end
can someone edit my c++ code where it will output to a file. I
am currently...
can someone edit my c++ code where it will output to a file. I
am currently using xcode.
#include <iostream>
#include <cctype>
#include <cstring>
#include <fstream>
using namespace std;
bool inputNum(int [],int&,istream&);
void multiply(int[],int,int[],int,int[],int&);
void print(int[],int,int,int);
int main()
{ifstream input;
int num1[35],num2[35],len1,len2,num3[60],len3=10,i;
input.open("multiplyV2.txt"); //open file
if(input.fail()) //is it ok?
{ cout<<"file did not open please check it\n";
system("pause");
return 1;
}
while(inputNum(num1,len1,input))
{inputNum(num2,len2,input);
multiply(num1,len1,num2,len2,num3,len3);
print(num1,len1,len3,1);
print(num2,len2,len3,2);
for(i=0;i<len3;i++)
cout<<"-";
cout<<endl;
print(num3,len3,len3,1);
//cout<<len1<<" "<<len2<<"
"<<len3<<endl;
cout<<endl;
}
system("pause");
}
void...