1、输入如下正确的常量说明串:constcount=10,sum=81.5,char1=‘f’,max=169,str1=“h*542..4S!AAsj”,char2=‘@’,str2=“aa!+h”;
输出:count(integer,10)sum(float,81.5)char1(char,‘f’)max(integer,169)str1(string,“h*542..4S!AAsj”)char2(char,‘@’)str2(string,“aa!+h”)int_num=2;char_num=2;string_num=2;float_num=1.2、输入类似如下的保留字const错误的常量说明串:Aconsttcount=10,sum=81.5,char1=‘f’;输出类似下面的错误提示信息:Itisnotaconstantdeclarationstatement!Pleaseinputastringagain!3、输入类似如下含常量名或常量值错误的常量说明串:constcount=10,12sum=81.5,char1=‘ff’,max=0016;
输出类似下面的错误提示信息:count(integer,10)12sum(Wrong!Itisnotaidentifier!)char1(Wrong!Therearemorethanonecharin‘’.)max(Wrong!Theintegercan’tbestartedwith‘0’.)int_num=1;char_num=0;string_num=0;float_num=0.
2024/1/27 0:49:23
3KB
编译原理
1