问题 单项选择题

下列程序的输出结果是( )。  #include<iostream.h>  void main( )  { char * str="12123434";   int x1=0,x2=0,x3=0,x4=0,i;   for(i=0;str[i]!=’’\0’’;i++)   switch(str[i])   { case’’1’’:x4++;    case’’2’’:x3++;    case’’3’’:x2++;    case’’4’’:x1++;   }   cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;

A.0

B.1

C.2

D.3

答案

参考答案:C

解析:对于文本框的MaxLength属性的设置如下:MaxLength属性用来设置允许在文本框中输入的最大字符数,如果将其设置为0,则在文本框中输入的字符不能超过32K,所以选项C)是正确的。

问答题
单项选择题