d

罗忠文  •  5天前


 int n,count=0; 
cin>>n; 
for(int a=1;a<=100;a++){ 
 for(int b=1;b<=100;b++){ 
  for(int c=1;c<=100;c++){ 
   if(n%a==0 && (n+1)%b==0 && (n+2)%c==0){ 
     count++; 
     cout<<a<<" "<<b<<" "<<c<<endl; 
    } 
   } 
  } 
 } 

if(count==0){ 
 cout<<"impossible"; 

return 0; 
 
}


评论: