网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

Write a script. to reverse (interchange 1 with 0) the n-th bit of a m-bit binary number.


参考答案

更多 “ Write a script. to reverse (interchange 1 with 0) the n-th bit of a m-bit binary number. ” 相关考题
考题 有下列程序,在横线添加;includeusing namespace std;class TestClass{public:TestCla 有下列程序,在横线添加; #include<iostream> using namespace std; class TestClass { public: TestClass (int n){number=n;} ______//拷贝构造函数 ~TestClass(){} private: int number; }; TestClass fun(TestClass p) { TestClass temp(P); return temp; } int main() { TestClsss obj1(10),obj2(0); TestClass obj3(obj1); obj2=fun(obj3); return 0; }A.TestClass(TestClass other){number=other.number;}B.TestClass(TestClass other){number=other.number;}C.TestClass(TestClass other){number;}D.TestClass(other){number=other.number;}

考题 有以下程序,在横线应添加()。includeusing namespace std;class TestClass{public:Tes 有以下程序,在横线应添加( )。 #include<iostream> using namespace std; class TestClass { public: TestClass(int n){number=n;} ______∥拷贝构造函数 ~TestClass(){} private: int number; }: TestClass fun(TestClass P) { TestClass temp(p); return temp; } int main() { TestClass obj1(10), obj2(0); TestClass obj3(obj1); obj2=fun(obj3); return 0; }A.TestClass(TestClass other){number=other.number;}B.TestClass(TestClass other){number=other.number;}C.TestClass(TestClass other){number;)D.TestClass(other){number=other.number;}

考题 已知C源程序如下: include include void reverse(char S[]){ int C,i,J; f 已知C源程序如下:include<stdio. h>include<string. h>void reverse(char S[]){int C,i,J;for(i=0,j=strlen(s)-1;i<j;i++,j++){c=s[i];s[i]=s[j];s[j]=c;}}void getHex(int number,char s[]){int I;i=0;while(number>0){if(number%16<10)s[i++]=number%16+'0';elseswitch(number%16){case 10:s[i++]='A';break;case 11:s[i++]='B';break;case 12:s[i++]='C';break;case 13:s[i++]='D';break;case 14:s[i++]='E';break;case 15:s[i++]='F';break;default:printf("Error");break;}number/=16;}s[i]:'\o';reverse(s);}int main(){unsigned int number;int i=0:char s[50];printf("%s","please input number;\n");scanf("%d",&number):getHex(number,s);i=0;while(s[i])printf("%c",s[i++]);return 0;}画出程序中所有函数的控制流程图。

考题 用递归函数求解斐波那契序列,在划线处填上正确语句。 int fib(number){ if (__________ || number == 2) return 1; else: return fib(number - 1) + fib(number - 2);A.number == 1B.number == 0C.number == 3D.number != 1

考题 在C#中,下列代码的运行结果是()。 public class Test { static void Main(String[] args) { int[] num = new int[5]{1,3,2,0,0}; Array.Reverse(num); foreach(int i in num) { Console.Write(i); } } }

考题 3、判断变量number是偶数的表达式是A.number%2==0B.number/2==1C.number>1 and number<3D.number>0

考题 已知P1.0和P1.6端口为输出引脚,下面哪一条命令可以同时点亮两个LED灯,但不影响其它的引脚。A.P1OUT = ~BIT0 + ~BIT6;B.P1OUT ^= BIT0 + BIT6;C.P1OUT |= BIT0 + BIT6;D.P1OUT = BIT0 + BIT6;

考题 5、在C#中,下列代码的运行结果是()。 public class Test { static void Main(String[] args) { int[] num = new int[5]{1,3,2,0,0}; Array.Reverse(num); foreach(int i in num) { Console.Write(i); } } }

考题 以下程序段的输出结果是? int number, digit; number = 15292; if (number ==0 ) { printf("0"); } else{ while (number != 0 ) { digit = number % 10; printf("%i", digit); number /= 10; } }A.29251B.15292C.1 5 2 9 2D.2 9 2 5 1