当前位置:网站首页>Niuke brush questions part6
Niuke brush questions part6
2022-06-11 18:29:00 【HHYX.】
Niu Ke brush questions
- Decimal variables i The value of is 100, So octal variables i The value of is :(C)
A 146
B 148
C 144
D 142
The question asks 10 Turn into the system 8 Base number , Here the transformation mode and 10 Turn into the system 2 Base is similar to , take 10 Hexadecimal digits are divided by 8 Quotient for each bit , The final result is 144, choice C
- The output after executing the following statement is (A)
int I=1;
if(I<=0)
printf("****\n") ;
else
printf("%%%%\n");
A %%
B ****
C There is a grammatical error , Cannot execute correctly
D %%%%
What is used here is printf Format to print , for example %d Print as integer ,%f Print as floating point numbers , The format string has certain rules ,% After that, you need to keep up with specific characters to format and print , If the following is an invalid meaning , It will output directly % Later content . Two consecutive % Will print out a %, So choose A
- For the following C One of the things that language statements describe correctly is (C)
char (*p)[16]
A p It's a length of 16 Character pointer array of
B p Is included 16 Character string
C p Yes, the pointing length is 16 Pointer to the character array of
D p It's a length of 16 Array of characters
here p stay () Neixianhe * combination , representative p It's a pointer , And then [] representative p The pointer points to a length of 16 Character array of , therefore C The options are right
- Array a The definition statement of is “float a[3][4];”, The following () Is an incorrect reference method to an array element .(D)
A a[i][j]
B *(a[i]+j)
C ((a+i)+j)
D (a+i4+j)
There are two ways to access arrays : One is to use [] How to access by subscribing , The other is send use finger The needle namely *(a+i) Access the contents of the array . Here you need to access a two-dimensional array . Dereference a two-dimensional array or use [] What you access is actually a one-dimensional array , Want to access an element in the array , It needs to be done again [] Or dereference to access , here ABC All meet the conditions ,D Not satisfied, so I choose D
- The output of the following program is __________.(D)
#include < iostream.h>
#define SQR(A) A*A
void main() {
int x=6,y=3,z=2;
x/=SQR(y+z)/SQR(y+z);
cout< < x< < endl;
}
A 5
B 6
C 1
D 0
In this question, we examine the use of macros . During program compilation , Macro expansion will be performed in the preprocessing stage , The macro will be directly replaced by the content it represents, that is A*A This is replaced by
x/=y+z*y+z/y+z*y+z
The result of the numerical operation carried in is :0 So choose D
- When n=5 when , The return value of the following function is :
int foo(int n){
if(n<2){
return n;
}
else
return 2*foo(n-1)+foo(n-2);
}
A 5
B 11
C 29
D 10
This question examines the understanding of recursive functions , The return condition of recursion is when n<2 Return when , take n=5 Nested recursion begins to unfold , The final result is 29 So choose C
- The following for C Linguistic ” The pointer “ What's wrong with the description is :(D)
A 32 The length of any type of pointer in a bit system is 4 Bytes
B The data type of the pointer declares the data type that the pointer actually points to the content
C A wild pointer is a pointer to an unallocated or freed memory address
D When using free After releasing a pointer content , The value of the pointer variable is set to NULL
In question ,D Option when used free After releasing the contents of the pointer, he will only p The space pointed to is freed and the pointer is not set to null , Avoid setting the pointer to null manually , So choose D
- Array is defined as ”int a[4][5];”, quote ”*(a+1)+2″ Express ()( From 0 OK, let's start ) (B)
A a[1][0]+2
B a Array number 1 Xing di 2 The address of the column element
C a[0][1]+2
D a Array number 1 Xing di 2 Value of column element
Each element in the two-dimensional array in the question is actually a one-dimensional array , therefore (a+1) Represents an array a The address of the first element in the .*(a+1) Represents the first element , It's a one-dimensional array , therefore *(a+1)+2 Express a The address of the element in the first row and the second column of the array , So choose B
- There's a structure like this :(A)
struct A{
long a1;
short a2;
int a3;
int *a4;
}
Excuse me at 64 Bit compiler sizeof(struct A) What's the calculated size ?
A 24
B 28
C 16
D 18
Calculate the size of the structure , Pay attention to it 64 Bit compiler environment , Therefore, the default alignment number is 8, The pointer size is also 8. Therefore, the calculation rules are based on the size of the structure :size = 4 + 2 + 4 + 2 + 8 + 4 = 24 So choose A
- The result of the operation is ?(D)
#include <iostream>
using namespace std;
int f(int n){
if (n==1)
return 1;
else
return (f(n-1)+n*n*n);
}
int main(){
int s=f(3);
cout<<s<<endl;
return 0;
}
A 8
B 9
C 27
D 36
The operation of recursive program is investigated in the question , Observe that the recursive exit condition is n be equal to 1 Recursively exit when , The value returned each time is n Add n The third power of , That is to say 1 + 2^3 + 3^3 =36 So the final result is D
边栏推荐
- 了解一下random库·1
- New work of "the father of LSTM": a new method towards self correcting neural network
- H.264概念
- 信号的处理与捕捉
- 全志科技T3開發板(4核ARM Cortex-A7)——MQTT通信協議案例
- [C语言]用结构体按分数高低降序输出学生的姓名和分数
- 力扣34在排序数组中查找元素的第一个和最后一个位置
- 5 minutes to understand the red, blue and purple in the attack and defense drill
- Force buckle 34 finds the first and last positions of elements in a sorted array
- Quanzhi Technology T3 Development Board (4 Core ARM Cortex - A7) - mqtt Communication Protocol case
猜你喜欢
随机推荐
[C语言]对一个数组的元素排序后平移元素
Apipost精妙使用技巧
Feign shares login information for request
Several commands related to domain name
全志T3开发板(4核ARM Cortex-A7)——系统启动阶段LOGO显示详解
.net core redis hyperloglog类型
Getting started with CTF
Sword finger offer (2nd Edition)
Labelme for image data annotation
牛客刷题——求最小公倍数
Cryptology Summary
Easycwmp source code analysis
. Net core redis hyperloglog type
神经网络与深度学习-2- 机器学习简单示例-PyTorch
MMA-Self-defining function
为何TI的GPMC并口,更常被用于连接FPGA、ADC?我给出3个理由
vim常用命令
Sa-Token 单点登录 SSO模式二 URL重定向传播会话示例
力扣39题组合总和
初识企业级平台
![[C语言]压缩字符串并添加标记字符](/img/b7/f7918f3ee0c409faffc70addd5ee65.png)




![[golang] leetcode - 349 Intersection of two arrays (hash table)](/img/92/03de54c9f08eae5bc920b04d2b8493.png)



