Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
427 B
1
Indexable
Never
#include <stdio.h>
int nt(int n) {
	int i;
	if (n<2) return 0;
	else for (i=2;i<=sqrt(n);i++) 
	if (n%i==0) return 0;
	return 1;
	}
int uoc(int n) {
	int i;
	for (i=1; i<=n;i++) 
	if (n%i==0) return 0;
	return 1;
	}
main () {
	int t;
	scanf ("%d", &t);
	while (t--) {
		int n;
		scanf ("%d", &n);
		int i,k;
		for (i=1;i<=n;i++) 
		{if (n%i==0&&nt(i)) k=i; }    
		printf ("%d\n", k);
		}
     
		}