subject
Computers and Technology, 01.09.2019 14:30 anyar

Ihave to writea piece of code to calculate the factorial of somewhat large numbers so the long long type won't suffize, so using vector, i stumbled upon some issues during run time:
'#include
#include
using namespace std;
vector factorial(short n)
{
vector v, z;
do
{
short m = n%10;
v. push_back(m);
}while(n/=10);
short temp = 0;
int x;
//short m = 0;
while(n-1)
{
for(auto & w : v)
{
x = w*(n-1) + temp;
temp = x/10;
z. push_back(x%10);
}
}
return z;
}
int main()
{
short t;
cin > > t;
vector v;
short temp;
while(
{
cin > > temp;
v. push_back(temp);
}
vector tmp;
for(auto & w : v)
{
tmp = factorial(w);
for(auto i=tmp. end(); i! =tmp. begin();
cout < < *i;
cout < < endl;
}
return 0;
}
'

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:40
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
question
Computers and Technology, 22.06.2019 10:50
Using least squares fitting, you are to fit the data sets to the following models and solve for the parameters ai , where i is the index of the parameter. the input/output data for the systems are linked in the bblearn site. for each of the systems use matlab to plot the supplied data vs. the model fit on one plot. include your code in the solutions. (a) linear fit "lineardata.mat" y=a1x^3 + a2x^2 + a3x + a4 (b) plant fit "plantdata.mat g(s) = a1/(s + a2)
Answers: 1
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
You know the right answer?
Ihave to writea piece of code to calculate the factorial of somewhat large numbers so the long long...
Questions
question
History, 09.10.2019 01:30
Questions on the website: 13722361