This task is to find the number of 'For' loops present in the given cpp program.

Ex Input:

int function(int n,int a)
{
	int kind=0;
	int i;
	if(n==1)
	return 1;
	for(i=a;i<=n;i++)
	{
		if(n%i==0)
		{
			if(n/i<i&&i!=n);
			else
			{
				kind=kind+function(n/i,i);
			}
		}
	}
	return kind;
}

int main()
{
	int m,n,i,sum;
	cin>>m;
	for(i=1;i<=m;i++)
	{
		cin>>n;
		sum=function(n,2);
		cout<<sum<<endl;
	}
	return 0;
}

Ex Output:
2


Ex Input:

/**
* @author ??
* @date 2010-12-1
* @description
* ??????:???? 
*/
int sum;
void calculate(int, int);


int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n;i++)
	{
		int m;
		sum  = 1;
		cin >> m;
		calculate(m, 2);
		cout << sum << endl;
	}
	return 0;
}
void calculate(int m,int begin)
{
	int i;
	int n = sqrt((double)m);
	for ( i = begin; i <= n; i++ )
	{
		if ( m % i == 0)
		{
			sum++;
			calculate(m / i,i);
		}
	}
}

Ex Output:
2


Ex Input:
/*
 * 187.cpp
 *
 *  Created on: 2011-11-22
 *      Author: think
 */
int count(int a,int n){
	if(a>n)return 0;
	if(a==n)return 1;
	int p=1;
	int i;
	for(i=a;i<=n;i++){
		if(n%i==0&&i<=n/i){
			p=p+count(i,n/i);
		}
	}
	return p;
}
int geshu(int N){
	int i;
	int s=1;
	for(i=2;i<=sqrt(N);i++){
		if(N%i==0){
			s=s+count(i,N/i);
		}
	}

	return s;
}
int main(){
	int N;
	cin>>N;
	int c[N];
	int j;
	for(j=0;j<N;j++){
		cin>>c[j];
	}
	for(j=0;j<N;j++){
		cout<<geshu(c[j])<<endl;
	}
	return 0;
}


Ex Output:

4