测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A48356. 有如下程序#include<stdio.h>#include<string.h>long fun(char str[]){ int i;long s=0,t; for(i=0;str[i]='\0';i++) { t=0; while(str[i]>='\0'&&str[i]<='9') { t=t*10+str[i]-'0';i++;} s=s+t; } return s; } void ma…

单选题 较难

题目描述

有如下程序

#include<stdio.h>

#include<string.h>

long fun(char str[])

{  int i;long s=0,t;

   for(i=0;str[i]='\0';i++)

   { t=0;

while(str[i]>='\0'&&str[i]<='9')

   { t=t*10+str[i]-'0';i++;}

   s=s+t;

   }

   return s;

  }

  void main()

  {

     char string[]="Welcome123To456Sichuan789";

long len;

len=fun(sting);

printf("%1d\n",len); 

}


程序运行的输出结果是(    )

选项(单选)

上一题 下一题