首页 > 土地资源管理
题目内容 (请给出正确答案)
[主观题]

有以下程序#include<stdio.h>int fun(char s[]){int n=0;while(*s<='9'&&*s>

有以下程序

#include<stdio.h>

int fun(char s[])

{int n=0;

while(*s<='9'&&*s>='0'){n=10*n+*s-'o';s++;)

return(n);

}

main

{char s[10]={'6','1','*','4','*','9','*',' 0','*');

printf("%d",fun(s));

}

程序运行的结果是()。

A.9

B.61490

C.61

D.5

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序#include<stdio.h>int fun(…”相关的问题
第1题
以下程序用来统计文件中字符个数。请填空。 include "stdio. h" main() { FILE *fp;long

以下程序用来统计文件中字符个数。请填空。 include "stdio. h" main() { FILE *fp;long num=OL; if((fp=fopen("fname.dat","r")==NULL) { Pirntf("Open error\n"); exit(0);} while(【 】) { fgetc(fp);num++; } printf("num=%1d\n",num-1); fclose(fp); }

点击查看答案
第2题
以下程序的功能是将字符串s中的数字字符放人d数组中,最后输出d中的字符串。例如,输入字符串abc123
edf456gh,执行程序后输出123456。请填空。 include<stdio. h> include<ctype. h> main() { char s[80], d[80]; int i, j; gets(s); for(i=j=0; s[i]!=\0; i++) if(【 】){ d[j]=s[i]; j++;) d[j]=\0; puts(D) ; }

点击查看答案
第3题
以下程序通过函数SunFun()调用F(x),x的值从0到10,这里F(x)=x2+1,由F函数实现,请填空。 inc

以下程序通过函数SunFun()调用F(x),x的值从0到10,这里F(x)=x2+1,由F函数实现,请填空。 include <stdio. h> int SunFun(int); int F(int); main () { pfintf("The sum = % d \n" ,SunFun(10) ); } SunFun(int n) { int x,s =0; for(x=0; x<=n; x++) s+ =F(【 】); return s; F(int x) { return (【 】);}

点击查看答案
第4题
下面程序由两个源程序文件:t4.h和t4.c组成,程序编译运行的结果是:【 】。 t4.h 的源程序为: d
efine N 10 denne f2(x) (x*N) t4.c 的源程序为: include <stdio. h> define M 8 define f(x) ((x)*M) include "t4.h" main() { int i, j; i=f(1+1); j=f2(1+1); printf(%d%d\n",i, j); }

点击查看答案
第5题
下面程序的功能:将字符数组a中下标值为偶数的元素从小到大排列,其他元素不变。请填空。 inclu
de<stdio. h> include<string. h> main() { char a[]="clanquage", t; int i, j, k; k=strlen(A) ; for(i=0; i<=k-2; i+=2) for(j=i+2;j<k; j+=2) if(【 】) { t=a[i]; a[i]=a[j]; a[j]=t; } puts(A) ; printf("\n"); }

点击查看答案
第6题
有以下程序()

A.#include

B.abcdef

C.ABCDEF

D.aBcDeF

E.AbCdEf

点击查看答案
第7题
有以下程序()

A.#include

B.5

C.24

D.32

E.40

点击查看答案
第8题
有以下程序()

A.#include

B.y=-1

C.y=0

D.y=1

E.while构成无限循环

点击查看答案
第9题
有以下程序 include<stdio.h> main() {chara=4; printf(%dha,a=a<<1); )A.8B.16C.40D.4

有以下程序 include<stdio.h> main() {chara=4; printf(%dha,a=a<<1); )

A.8

B.16

C.40

D.4

点击查看答案
第10题
有以下程序: include<stclio.h> main() { char c; while((c=getchar())!=?)pu

有以下程序: include<stclio.h> main() { char c; while((c=getchar())!=?)putchar(--c); } 程序运行时,如果从键盘输入:Y?N?<回车>,则输出结果为【 】。

点击查看答案
第11题
有以下程序 include <lostream> using namespace std; int main() { int

有以下程序 include <lostream> using namespace std; int main() { int i=010,j=10; cout<<(i)<<","<<j--<<endl; return 0; } 则该程序运行后的输出结果是【 】。

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改