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


int function(int a, int m)
{
	int sum=1,i;
	if(a>m)
		return 0;
	else
	{
		for(i=a;i<m;i++)
		{
			if(m%i==0)
				sum=sum+function(i,m/i);
		    else 
			continue;
		}
	return sum;

	}
}

void main()
{
	int n,i,m[100];

	scanf("%d",&n);

	for(i=0;i<=n-1;i++)
	{
		scanf("%d",&m[i]);
	}

	for(i=0;i<=n-1;i++)
	{
		printf("%d\n",function(2,m[i]));

	}
}



3

//???2010?12?1?

//???1000010586_???

//???????

int m , num;
int make( int a );
int pan( int a );
int main()
{
	int n , a , i;
	cin >> n;
	for( i = 1 ; i <= n ; i++ )
	{
		cin >> a;
		num = 0;
		m = a;
		cout << make( a ) << endl;
	}
	return 0;
}
int pan( int a )
{
	int n = 0 , i;
    for ( i = 1 ; i <= sqrt( a ) ; i ++ )
	{
		if ( a % i == 0 )
			n++;
	}
    if ( n == 1 )
		return 0;
	else
		return 1;
}
int make( int a )
{
	int i , j , ans;
	ans = sqrt( a );
	if ( pan( a ) == 0 )
	{
		num++;
		return num;
	}
	else
	{
		num++;
		for ( i = m / a ; i <= ans ; i++ )
		{
			if ( i == 1 ) continue;
			if ( a % i == 0 )
			{
				m = a;
			    num = make( a / i );
			}
		}
		if ( i == ans + 1 )
			return num;
	}
	return num;
}

3

/*
 * e.cpp
 * ?????
 * ????: 2010-12-8
 * ???????
 */

int find_factor(int a,int b)
{
	int i,sum=0;
	if(a==1) return 1;
	for(i=b;i<=a;i++)
		if(a%i==0)
			sum=sum+find_factor(a/i,i);
	return sum;
}

int main(void)
{
	int n;
	cin>>n;
	int a;
	for(int i=1;i<=n;i++)
	{
		cin>>a;
		cout<<find_factor(a,2)<<endl;
	}
	return 0;
}

2

