联发科技嵌入式_MTK深圳公司嵌入式软件工程师笔试题

//MTK深圳嵌入式软件工程师笔试题(B卷)

//1*****************************************

#define pi 3.14

#define Area(R) pi*R*R

main()

{

int r1=5,r2=2;

double s=0;

s=Area(r1-r2);

printf("The area is %f",s);

}

//求结果

//2*********************************************

//函数 int compare(int a,int b),定义为该函数的函数指针P:为_______________

//3*********************************************

#include

void sub(char*s,int num)

{

int i ,j=num;

char t;

while(j-->1)

{

for(i=0;i

{

if(s[i]

{

t=s[i];

s[i]=s[i+1];

s[i+1]=t;

}

}

}

}

main()

{

char*s="CEAeded";

sub(s,6);

printf("%s\n",s)

}

//求结果

//4**********************************************

//交换两个变量的值,不使用第三个变量,即a=3,b=5交换

//后b=3,a=5

unsigned char a=3,b=5;

//5**************************************************

#define N 100

void GetMemory1(char*p)

{

p=(char*)malloc(sizeof(char)*N);

strcpy(p,"Have a good day!");

}

char*GetMemory2(void)

{

char p[]="Have a good day!";

return p;

}

void main(void)

{

char*str1=NULL,*str2=NULL;

GetMemory1(str1);

GetMemory2(str2);

printf("\nstr1:%s",str1);

printf("\nstr2:%s",str2);

//6******************************************************

//构造N个结点的单链表返回链表头指针,要求链表中各结点顺序

//与结点数据输入顺序相反,例如输入1,2,3,4,5,形成的链表为

//head->5 4 3 2 1 ,补充程序

#define N 10

typedef struct Node

{

int data;

struct Node*next;

}NODE;

int Get_Data(int i);//定义省略

Node*Create_u()

{

int i;

NODE*p,*Head=NULL;

for(i=0;i

{

VP=New NODE;

P->Data=Get_Data(i);

________________;

________________;

}

return Head;

}

//7**********************************************

//N个结点链表,每个结点中存放一个字符,判断链表存放的字符是否

//中心对称,即a b c c b a或a b c b a,补充程序

typedef struct Node

{

int data;

struct Node*next;

}NODE;

bool Is_symmeic(NODE*head,*int n)

{

char D[N];

int i,d;

__________;

for(i=0;i

{

D[i]=head->data;

head=head->next;

}

if(__________)

{

head=head->next;

}

while(head)

{

_______________;

if(D[i]!=head->data)

{

return false;

}

head=head->next;

}

return true;

}

//8*************************************

//str中只含有大写和小写字母函数change_move(char*str)将字符串中大写改成*并

//移到前面小写后返回*的个数

//如AabBdcYY改为*****abd,返回5

int chang_move(char*str)

{

int len,i,curstr=-1;

len=strlen(str);

for(i=len-1;i>=0;i--)

{

if(str[i]>='A'&&str[i]<='Z')

{

str[i]='*';

if(cursor==-1)

{

cursor=i;

}

else if(cursor>i)

{

_____________;

str[i]='*';

_____________;

}

}

return____________;

}

//9***********************************************

//求两个字符串的第一个公共子串,并返回该子串

//如:"a b c d e f g e h i" "a a c d e f * * g e h i"

//第一个为"c d e f";不许用strcmp()

char*Maxf(char*str1,char*str2)

{

}

posted on 2008-03-10 13:36 勇敢空心人 阅读(4871) 评论(3)  编辑 收藏 引用

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值