My issue
approach for this question in easy way
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int n;
cin>>n;
bool flag=true;
int i;
int count=0;
for(i=2;i*i<=n;i++){
if(n%i==0){
flag=false;
for(int j=2;j*j<=n;j++){
if(i%j!=0){
count++;
cout<<count<<endl;
}
}
// cout<<count<<endl;
}
}
if(n==1){
cout<<"1"<<endl;
}
if(flag){
cout<<"1"<<endl;
}
// else{
// int prime=0;
// for(int i=2;i*i<=n;i++){
// if(n)
// }
// }
}
return 0;
}
Learning course: Chitkara DSA Bootcamp
Problem Link: CodeChef: Practical coding for everyone