简答题:下列给定程序中函数proc的功能是:取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。例如,当s中的数为1234

  • 题目分类:C语言
  • 题目类型:简答题
  • 号外号外:注册会员即送体验阅读点!
题目内容:
下列给定程序中函数proc的功能是:取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。例如,当s中的数为123456789时,t中的数为2468。请修改程序中的错误,使它能得出正确的结果。
注意:不要改动main()函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
//****found****
void proc(1ong s,long t)
{long s1=10;
s/=10:
*t=s%10;
//****found****
while(s<0)
{ s=s/100;
*t=s%10*s1+*t;
s1=s1*10: }
void main()
{long S,t;
system(”CLs”);
printf(”\nPlease enter s:”);
scanf(”%ld”,&s);
proc(s,&t):
printf(”The result is:%ld\\n”,t);
}
参考答案:【答案仅供学习,请勿对照自行用药等】
答案解析:

Which arrangement is taking place at the time that was plan

Which arrangement is taking place at the time that was planned?A.the meeting

查看答案

The paragraph following the passage most likely discuss

The paragraph following the passage most likely discussA.unusual ways to advert

查看答案

How large is TVROs' market share?

How large is TVROs' market share?A.about a quarter B.about a half. C.three quart

查看答案

Look at the picture below and write an essay about l20 word

Look at the picture below and write an essay about l20 words,making reference t

查看答案