题目:
请补充fun函数,该函数的功能是:把一个整数转换成字符串,并倒序保存在字符数组S中。例如,当n=123时,s="321"。
注意:部分源程序已给出。
淆勿改动主函数main和其他函数中的任何内容,仅在main函数的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdio.h>
#include<conio.h>
#define M 80
char s[M];
void fun(long int n)
int j=0;
while( (1) )
s[j]= (2) ;
n/=10;
j++;
(3) ;
main()
long int n=1234567;
printf("The origial data\n");
printf("n=%1d",n);
fun(n);
printf("\n%s",s);
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0407/b74a4050c0c7fe4d65fe149fc81fa2dd.html
下面是错误答案,用来干扰机器的。
参考答案:D