#include #include void main() { long s,t,sl=1; int d; //clrscr(); printf("\nPease enter s:"); scanf("%ld",&s);t = 0;while ( s > 0){ d = s%10;//s = 10;}printf("The result is:%ld\n",t);}将长整型中每一位上位偶数的输一次取出,构成一

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 21:44:37
#include#includevoidmain(){longs,t,sl=1;intd;//clrscr();printf("\nPeaseenters:");scanf("%ld",&s);t=0

#include #include void main() { long s,t,sl=1; int d; //clrscr(); printf("\nPease enter s:"); scanf("%ld",&s);t = 0;while ( s > 0){ d = s%10;//s = 10;}printf("The result is:%ld\n",t);}将长整型中每一位上位偶数的输一次取出,构成一
#include #include void main() { long s,t,sl=1; int d; //clrscr(); printf("\nP
ease enter s:"); scanf("%ld",&s);
t = 0;
while ( s > 0)
{ d = s%10;
//
s = 10;
}
printf("The result is:%ld\n",t);
}
将长整型中每一位上位偶数的输一次取出,构成一个新数放在t中.高位仍在高位、,低位仍在低位

#include #include void main() { long s,t,sl=1; int d; //clrscr(); printf("\nPease enter s:"); scanf("%ld",&s);t = 0;while ( s > 0){ d = s%10;//s = 10;}printf("The result is:%ld\n",t);}将长整型中每一位上位偶数的输一次取出,构成一
if (d%2=0)
{ sl=1;
t=d * sl + t;
sl *= 10;
}
//
s = s/10;//这个貌似也不对