Submission #3551885


Source Code Expand

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<cstring>
using namespace std;
int f(int a)
{
	if(a==1)	return 0;
	if(a==2)	return 1;
	if(a%2==0)	return 0;
	for(int i=3;i<=sqrt(a);i+=2)
	{
		if(a%i==0)	return 0;
	}
	return 1;
}
int main()
{
	int a;
	while(cin>>a)
	{
		if(a!=0)
		{
			for(int i=1;i<=n;i++)
			{
				if(a%i==0&&f(a/i)==1)
				{
					cout<<i<<endl;break;
				}
			}
		}
	}
	return 0;
}

Submission Info

Submission Time
Task B - Working for the World
User luogu_bot5
Language C++ (GCC 5.4.1)
Score 0
Code Size 485 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:19: error: ‘n’ was not declared in this scope
    for(int i=1;i<=n;i++)
                   ^