Untitled
#include <stdio.h> #include <math.h> int main(){ int x,n; scanf("%d",&n); for (x=1;x<=n;x++){ int a,i; scanf("%d",&a); for (i=2;i<=a;i++){ int b=a%i; if(b==0){ printf("%d ",i); a=a/i; i=1; } } printf("\n"); } return 0; }
#include <stdio.h> #include <math.h> int main(){ int x,n; scanf("%d",&n); for (x=1;x<=n;x++){ int a,i; scanf("%d",&a); for (i=2;i<=a;i++){ int b=a%i; if(b==0){ printf("%d ",i); a=a/i; i=1; } } printf("\n"); } return 0; }