主题:函数fun的功能是:从低位开始取出长整型变量s中偶数位上的数,依次构成一个新数放在t中。
#include<conin.h>
#include<stdio.h>
#include<stdlib.h>
void fun(long s,long t)
{long sl=10;
s/=10;
*t=s%10;
while (s<0)
{s=s/100;
*t=s%10*s1+*t
s1=s1*10;
}
}
main()
{long s,t;
system("cls");
printf("\nPlease enter s:");scanf("%ld",&s);
fun(s,&t)
printf("The result is :%ld\n",t)
}
求哪里错了
#include<stdio.h>
#include<stdlib.h>
void fun(long s,long t)
{long sl=10;
s/=10;
*t=s%10;
while (s<0)
{s=s/100;
*t=s%10*s1+*t
s1=s1*10;
}
}
main()
{long s,t;
system("cls");
printf("\nPlease enter s:");scanf("%ld",&s);
fun(s,&t)
printf("The result is :%ld\n",t)
}
求哪里错了