久久九九国产无码高清_人人做人人澡人人人爽_日本一区二区三区中文字幕_日韩无码性爱免费

名企筆試題1

時(shí)間:2023-02-24 07:07:59 筆試題目 我要投稿
  • 相關(guān)推薦

名企筆試題1

Sony筆試題
1.完成下列程序
*
*.*.
*..*..*..
*...*...*...*...
*....*....*....*....*....
*.....*.....*.....*.....*.....*.....
*......*......*......*......*......*......*......
*.......*.......*.......*.......*.......*.......*.......*.......
#include <stdio.h>
#define N 8
int main()
{
int i;
int j;
int k;
---------------------------------------------------------
| |
| |
| |
---------------------------------------------------------
return 0;
}
2.完成程序,實(shí)現(xiàn)對(duì)數(shù)組的降序排序
#include <stdio.h>
void sort( );
int main()
{
int array[]={45,56,76,234,1,34,23,2,3}; //數(shù)字任//意給出
sort( );
return 0;
}
void sort( )
{
____________________________________
| |
| |
|-----------------------------------------------------|
}
3.費(fèi)波那其數(shù)列,1,1,2,3,5……編寫(xiě)程序求第十項(xiàng)?梢杂眠f歸,也可以用其
他方法,但要說(shuō)明你選擇的理由。
#include <stdio.h>

名企筆試題1

int Pheponatch(int);
int main()
{
printf("The 10th is %d",Pheponatch(10));
return 0;
}
int Pheponatch(int N)
{
--------------------------------
| |
| |
--------------------------------
}
4.下列程序運(yùn)行時(shí)會(huì)崩潰,請(qǐng)找出錯(cuò)誤并改正,并且說(shuō)明原因。
#include <stdio.h>
#include <malloc.h>
typedef struct{
TNode* left;
TNode* right;
int value;
} TNode;
TNode* root=NULL;
void append(int N);
int main()
{
append(63);
append(45);
append(32);
append(77);
append(96);
append(21);
append(17); // Again, 數(shù)字任意給出
}
void append(int N)
{
TNode* NewNode=(TNode *)malloc(sizeof(TNode));
NewNode->value=N;
if(root==NULL)
{
root=NewNode;
return;

}
else
{
TNode* temp;
temp=root;
while((N>=temp.value && temp.left!=NULL) || (N<temp. value && temp. right
!=NULL
))
{
while(N>=temp.value && temp.left!=NULL)
temp=temp.left;
while(N<temp.value && temp.right!=NULL)
temp=temp.right;
}
if(N>=temp.value)
temp.left=NewNode;
else
temp.right=NewNode;
return;
}
}

 

【名企筆試題1】相關(guān)文章:

名企筆經(jīng)108-08

名企筆試題07-12

名企經(jīng)典筆試題07-27

名企筆試題精選07-07

名企面試題07-31

名企筆試題308-08

名企筆試題608-08

名企筆試題708-08

名企筆試題208-08