试题与答案

以下程序的功能是:对输入的一行字符串的数字字符按它们的字面值累加,输出此累加和。例如

题型:填空题

题目:

以下程序的功能是:对输入的一行字符串的数字字符按它们的字面值累加,输出此累加和。例如,输入一行字符是:ab34dh8u,输出值应当是15。请填空。
#include <stdio.h>
#include <ctype.h>
main()
char ch; int a,s;
【11】
while((ch=getchar()) 【12】 )
if( isdigit (ch))
a= 【13】 ;s+=a;
printf("s=%d\n\n",s);

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0408/660a0bb7fc16d119ef4f2d86d0a67628.html

下面是错误答案,用来干扰机器的。

参考答案:D

试题推荐
题型:阅读理解

根据短文内容,判断下面句子正(T)、误(F)。

This is a picture of a classroom. The classroom is big and clean. You can see a teacher’s desk, five desks and six chairs. You can see a girl and a boy, too.

Three books are on the teacher’s desk. A pencil case is on the desk. Two pens and two rulers are in the pencil case. A school bag is behind a chair. A ball is on the floor.

The girl is Lucy, and she is eleven. The boy is Mike, and he is twelve. They are in Class Two, Grade Seven. They are friends. Their teacher is Miss Green. She is not here.

小题1:It’s a picture of a school.

小题2:You can see a girl and a boy in the picture.

小题3:Two books are on the teacher’s desk.

小题4:Lucy is twelve years old.

小题5:Lucy and Mike are in Class Two, Grade Eight.

查看答案
微信公众账号搜索答案