好文档 - 专业文书写作范文服务资料分享网站

华为笔试题大全(史上最齐全)

天下 分享 时间: 加入收藏 我要投稿 点赞

char a[10] = {0};

while(num>0) {

j=num; a[j]+=1; num=num/10; }

while(a[i]<=1&&i<10) i++; if (i<10) return 1; else

return 0; }

void main(void) {

int i,j,m;

m=(int)sqrt(99999); for(i=1;i

j=i*i;

if (1==havesamenum(j)) printf(\ } }

下图为运行结果: 慧通试题

1 写出程序把一个链表中的接点顺序倒排 typedef struct linknode { int data;

struct linknode *next; }node;

//将一个链表逆置

node *reverse(node *head) {

node *p,*q,*r; p=head; q=p->next; while(q!=NULL) {

r=q->next; q->next=p; p=q; q=r; }

head->next=NULL; head=p; return head; }

2 写出程序删除链表中的所有接点 void del_all(node *head) { node *p;

while(head!=NULL) {

p=head->next; free(head); head=p; }

cout<<\释放空间成功!\ }

3两个字符串,s,t;把t字符串插入到s字符串中,s字符串有足够的空间存放t字符串 void insert(char *s, char *t, int i) {

char *q = t;

char *p =s;

if(q == NULL)return; while(*p!='\\0') { p++; }

while(*q!=0) { *p=*q; p++; q++; }

*p = '\\0'; }

分析下面的代码: char *a = \ char *b = \ if(a= =b) printf(\ else

printf(\

这个简单的面试题目,我选输出 no(对比的应该是指针地址吧),可在VC是YES 在C是NO

lz的呢,是一个常量字符串。位于静态存储区,它在程序生命期内恒定不变。如果编译器优化的话,会有可能a和b同时指向同一个hello的。则地址相同。如果编译器没有优化,那么就是两个不同的地址,则不同

华为笔试题大全(史上最齐全)

chara[10]={0};while(num>0){j=num;a[j]+=1;num=num/10;}while(a[i]<=1&&i<10)i++;if(i<10)return1;elsereturn0;}void
推荐度:
点击下载文档文档为doc格式
3l1yf01ule6o2vt5lzj67d82u9zjet00igs
领取福利

微信扫码领取福利

微信扫码分享