instruction:
This task is to find the number of 'For' loops present in the given cpp program.
question:
int num=1,k=0;
int count(int n)
{
for(int i=2;i<=sqrt(n);i++)
{
if(n%i==0&&i>=k)
{
num++;
k=i;
count(n/i);
k=0;
}
}
return (num);
}
int main()
{
int i,n,a[100];
cin>>n;
for(i=0;i<n;i++)
{
cin>>a[i];
}
for(i=0;i<n;i++)
{cout<<count(a[i])<<endl;num=1;k=0;}
return 0;
}
answer:
3

question:

int digui(int m,int n,int sum)
{
int i;
sum++;
if(sqrt(m)<n)
return sum;
else{
for(i=n;i<=sqrt(m);i++){
if(m%i==0)
sum=digui(m/i,i,sum);
}
return sum;
}
}

void main()
{
int n,a;
scanf("%d",&n);
while(n--){
scanf("%d",&a);
printf("%d
",digui(a,2,0));
}
}
answer:
1

question:
int devide(int n,int k)
{
int s,i;
s=1;
for(i=k;i<=sqrt(n*1.0);i++)
{
if(n%i==0)
{
s=s+devide(n/i,i);
}
}
return s;
}
int main()
{
int n,a[200],i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(i==0)printf("%d",devide(a[i],2));
else printf("
%d",devide(a[i],2));
}
return 0;
}
answer:
2