Posted in 面试题 onJuly 31, 2014
解:#include
main()
{
unsigned a,b,c;
int n;
printf(“input a:”);
scanf(“%o”,&a);
printf(“input n:”);
scanf(“%d”,&n);
b=a c=a>>n;
a=b|c;
printf(“%o\n”,a);
}
main()
{
unsigned a,b,c;
int n;
printf(“input a:”);
scanf(“%o”,&a);
printf(“input n:”);
scanf(“%d”,&n);
b=a c=a>>n;
a=b|c;
printf(“%o\n”,a);
}
实现向右循环移位
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Tags in this post...
Reply on: @reply_date@
@reply_contents@