Source Code:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
unsigned long n,x;
scanf("%lu",&n);
while(n--)
{
scanf("%lu",&x);
for(unsigned long i=1;i<=x;i++)
{
if(x%i==0)
{
printf("%lu ",i);
}
}
printf("\n");
}
return 0;
}
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
unsigned long n,x;
scanf("%lu",&n);
while(n--)
{
scanf("%lu",&x);
for(unsigned long i=1;i<=x;i++)
{
if(x%i==0)
{
printf("%lu ",i);
}
}
printf("\n");
}
return 0;
}
Comments
Post a Comment