10个数,前3个数变为1,其他变为0,把语句补充完整y<-x<-c(1:10)for (i in 1:10) { if( ) y[i]=1 else y[i]=0 }print(y)
A、x[i]==1|x[i]==2|x[i]==3;
B、x[i]==1&x[i]==2&x[i]==3;
C、x[i]==1!x[i]==2!x[i]==3;
D、x[i]==1&&x[i]==2&&x[i]==3
发布时间:2024-10-13 15:58:55
A、x[i]==1|x[i]==2|x[i]==3;
B、x[i]==1&x[i]==2&x[i]==3;
C、x[i]==1!x[i]==2!x[i]==3;
D、x[i]==1&&x[i]==2&&x[i]==3