单选题

设有以下程序段
int x=0,s=0;
while (!x!=0)s+=++x;
printf(“%d”,s);
(50)
【正确答案】 B
【答案解析】[解析] 当x=0时,!x=1,1 !=0,s=1;当x=1时,!x=0,0==0,循环结束。