开灯问题

#include<stdio.h>
int main(){
    int People,Lamp;
    int current_deal,current_deal1;
    scanf("%d%d",&People,&Lamp);
    for(current_deal1=1;current_deal1<=People;current_deal1++)
    {
        int count=0;
        for(current_deal = 2;current_deal<=Lamp;current_deal++ ){
            if(!(current_deal1%current_deal)) count++;
        }
        if(count%2==0) printf("%d ",current_deal1);
    }
printf("\n");
    return 0;
}

你可能感兴趣的:(开灯问题)