C 中有多少基本数据类型?为什么我的C 代码数据读不出来?还有夏尔。C 定义了另外两个基本数据类型:bool和wchar _ T,有些基本数据类型可以带符号,一个c 程序输出数据 type的长度是错误的,从这个例子我们可以知道:charcintddoublea肖特;shortf} y;coutc 中如何保存和删除数据。
# include # includeusingnamespacestd;inti prime(intn){ inti;对于(I2;i * i1}intmain(){inti,n0;对于(I2;i>ws,str);Cin>>ws的意思是首先跳过输入缓冲区开头的空白字符,然后读入str。这种方法适用于中间有多个空格的情况。
2、一个C 程序输出 数据类型长度以上大护理师的说法不正确。从这个例子可以知道:# include # include voidman(){ struct example { charb;charcintddoublea肖特;shortf} y;coutlen0} int getlength(){ return this > len;} intget elem(inti){ if(ithis > len)return 0;elsereturnthis > data[i1];} int locate(elem typex){ inti 0;while(this>data[i]!x)i ;if(i>this>len)返回0;elsereturni 1;}intInsElem(Elemtypex。