91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

從鍵盤上輸入一串字符(包括字母、數(shù)字等),最后以“;”結(jié)束,編寫程序識別出其中的無符號數(shù)。 自己寫的代碼,C語言,可以正常運(yùn)行

資源截圖

代碼片段和文件信息

#include
#include
#include
#include
main(){
int?w=0p=0j=0d=0;
int?e=1;
char?str[100];
//char?cj1[10];
float?cj2=0;
printf(“Please?Input?a?String:\n“);
gets(str);
int?i=0;
//while(str[i]!=‘;‘)



if(str[i]>=‘0‘&&str[i]<=‘9‘)//第一個--數(shù)字否?
{
while(str[i]!=‘;‘)//第一個--方框?
{
d=str[i]-48;
w=w*10+d;
i=i+1;
if(str[i]<=‘0‘||str[i]>=‘9‘)
{
//i=i+1;
// printf(“(1)“);
break;
}

}
if(str[i]==‘.‘)
{
i=i+1;
if(str[i]>=‘0‘&&str[i]<=‘9‘)
{
while(str[i]!=‘;‘)//第一個--方框?
{
d=str[i]-48;
w=w*10+d;
j=j+1;
i=i+1;
if(str[i]<=‘0‘||str[i]>=‘9‘)
{
//i=i+1;
break;?
}

}
if(str[i]==‘E‘)//缺
? {
? i=i+1;
if(str[i]==‘-‘)
{
e=-1;
i=i+1;
}
else?if(str[i]==‘+‘)
{
i=i+1;
}


if(str[i]>=‘0‘&&str[i]<=‘9‘)
{
while(str[i]!=‘;‘)//第一個--方框?
{
d=str[i]-48;
p=p*10+d;
i=i+1;
if(str[i]<=‘0‘||str[i]>=‘9‘)
{
//i=i+1;
break;
}

}
i=i-1;
cha

評論

共有 條評論