1.[编程]给定一个整数,获得它的逆序数,如整数87231,逆序后为13278

// nixushu.cpp : Defines the entry point for the console application.
//
//思路是先转成字符串再操作
#include "stdafx.h"
#include <string>
#include <iostream>//返回值为计算出的逆序数
int fun(int num)
{char an[20];int len, t, neg = 0;  //len:字符串的长度,t:交换临时变量,此种情况定义成int和char是一样的if(num < 0){num = -num;neg = 1; //看来neg是标识num是否为负数,如果为负数,只计算整数部分}sprintf(an, "%d", num);    //把一个格式化数据写到字符串中len = strlen(an);  //返回字符串的长度for(int i = 0; i < len/2; i++)  //前后交换{t = an[i];an[i] = an[len-1-i];an[len-1-i] = t;}num = atoi(an);   //把字符串转换成整数等return neg?-num:num;
}int _tmain(int argc, _TCHAR* argv[])
{int num = 0;std::cin>>num;std::cout<<fun(num)<<std::endl;return 0;
}
// nixushu2.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include <iostream>int _tmain(int argc, _TCHAR* argv[])
{std::cout<<"输出方式2"<<std::endl;int num;std::cin>>num;for(; num > 0; num = num/10){std::cout<<(num%10);}return 0;
}

2.[编程]两个无序链表A和B,将其合并为递增排列的一个链表

#include<stdio.h>
#include<stdlib.h>
struct stud/*定义链表*/
{
int data;
struct stud *next;
};
void pai_xue(struct stud *head1,struct stud *head2,int count1,int count2)/*冒泡排序法*/
{
int i,j,temp=0;
struct stud *p;for(i=0;i<count1-1;++i)for(p=head1->next;p->next!=NULL;p=p->next)/*对链表1进行排序*/{if(p->data>p->next->data){temp=p->data;p->data=p->next->data;p->next->data=temp;}}for(i=0;i<count2-1;++i)for(p=head2->next;p->next!=NULL;p=p->next)/*对链表2进行排序*/{if(p->data>p->next->data){temp=p->data;p->data=p->next->data;p->next->data=temp;}}printf("\n链表1排完序后\n");/*输出链表1和2*/p=head1->next;while(p){printf("%d",p->data);p=p->next;}printf("\n");printf("\n链表2排完序后\n");p=head2->next;while(p){printf("%d",p->data);p=p->next;}printf("\n");
}void main()
{
struct stud *head1,*head2,*p,*q,*head3;
int count1=1,count2=1;head3=(struct stud *)malloc(sizeof(struct stud *));/*定义链表头结点,并分配空间*/
head3->next=NULL;head1=(struct stud *)malloc(sizeof(struct stud *));
head2=(struct stud *)malloc(sizeof(struct stud *));
p=(struct stud *)malloc(sizeof(struct stud *));
q=(struct stud *)malloc(sizeof(struct stud *));head1->next=NULL;
head2->next=NULL;printf("输入一个数据以999结束\n");
scanf("%d",&p->data);while(p->data!=999)/*链表1输入数据*/
{
count1++;
p->next=head1->next;
head1->next=p;
printf("输入一个数据以999结束\n");
p=(struct stud *)malloc(sizeof(struct stud *));
scanf("%d",&p->data);
}printf("现在开始给第二个链表输入数据\n");printf("输入一个数据以999结束\n");
scanf("%d",&q->data);while(q->data!=999)/*链表2输入数据*/
{
count2++;
q->next=head2->next;
head2->next=q;
printf("输入一个数据以999结束\n");
q=(struct stud *)malloc(sizeof(struct stud *));
scanf("%d",&q->data);
}
pai_xue(head1,head2,count1,count2);head1=head1->next;
head2=head2->next;
while(head1!=NULL&&head2!=NULL)/*将排序好的链表1和2 的数据导入链表3*/
{if(head1->data<=head2->data){p=head1->next;head1->next=head3->next;head3->next=head1;head1=p;}  else{q=head2->next;head2->next=head3->next;head3->next=head2;head2=q;}
}
if(head1!=NULL)/*如果有链表1或2的数据不为空,将剩下的数据导入链表3中*/
{  p=head1;while(p!=NULL){q=p->next;p->next=head3->next;head3->next=p;p=q;}
}
if(head2!=NULL)
{  q=head2;while(q!=NULL){p=q->next;q->next=head3->next;head3->next=q;q=p;}
}q=head3->next;/*将链表倒置,原来是由大到小,倒置成由小到大*/
head3->next=NULL;
while(q!=NULL)
{p=q->next;q->next=head3->next;head3->next=q;q=p;
}printf("两个链表合并后由小到大为\n");p=head3->next;
while(p)
{
printf("%d",p->data);
p=p->next;
}
}

3. [编程]找出两个排序数组的合集,如[1,3,4,5,6],[3,5,7,9],合集是[3,5],用一种高效的方法编程实现
4. [编程]将一个句子的单词反过来(单词原样),比如"i am cheating"变成"cheating am i"
5. [设计]有一个遥控,有四个按钮,编号为0,1,2,3,其中0,2控制电器1和电器2的开,1,3控制电器1,2的关,设计一个系统,要求能够开关客厅的电视和卧室的灯,设计一个系统,设计相关的类,要求具有较好的扩展性,最好采用UML方式,或者描述类的主要属性和关键操作
论述题: 描述自己在开发过程解决的一个最成功的问题,描述这个问题,并说明是用什么方法、途径解决的,给出必要的数据结构和算法

广联达软件开发笔试题相关推荐

  1. 2014京东校园招聘-软件开发笔试题

    2019独角兽企业重金招聘Python工程师标准>>> 今天去川大参加了京东的宣讲,外加笔试,那叫一个人山人海啊,貌似有1000人,通道和走廊甚至演讲台上都站满了人,oh my go ...

  2. leetcode笔记:Gray Code(2016腾讯软件开发笔试题)

    2019独角兽企业重金招聘Python工程师标准>>> 一.题目描述 The gray code is a binary numeral system where two succe ...

  3. 百度2015校园招聘软件开发笔试题及答案

    简单题(本题共30分) 请简述Tcp-ip的3次握手以及4次挥手过程?并解释为何关闭连接需要4次挥手(10分) 详细答案参见TCP/IP协议三次握手与四次握手流程解析 TCP三次握手.四次挥手过程如下 ...

  4. 小米2019秋招软件开发笔试题A选择部分解析

    之前去牛客做了一下,顺手把答案和解析写下. 只是个人的理解,个人水平有限,如果有哪里错了各位可以提醒一下我改一下,非常感谢. 1.哪些语言是面向对象的?(多选) 很明显,排除法的话:c肯定不是,jav ...

  5. 美团C++软件开发笔试题

    题一 题目描述 在观星的时候,一种常用的方式是划出类似于正方形的区域内,确定其中所有的星星的坐标. 现在我们在星空(一个无限大的二维平面)上建立坐标系,由于星星很小,我们忽略它的面积,认为每一个星星是 ...

  6. 小米秋招软件开发笔试题

  7. [历年IT笔试题]2014京东校园招聘-软件开发笔试题

    第一部分 数据结构与算法 1:链表不具备的特点是 A 可随机访问任何一个元素 B 插入,删除操作不需要移动元素 C 无需事先估计存储空间大小 D 所欲存储空间与线性表长度成正比 2:在一个单链表中,若 ...

  8. 深圳科陆集团2015校招软件开发笔试题

    原文:http://www.dy1280.com/thread-853-1-1.html 估计很多人都没听说过这个公司,深圳市科陆电子科技股份有限公司是深圳市高新技术企业,专门从事电力精密测试设备.电 ...

  9. OPPO C++软件开发笔试题 2020.8.29

    三道编程题都是竞赛题,难度很大. 1. 第k大斜率 在平面直角坐标系上,有 n 个不同的点.任意两个不同的点确定了一条直线.请求出所有斜率存在的直线按斜率从大到小排序后,第 k 条直线的斜率为多少. ...

最新文章

  1. php 操作数组 (合并,拆分,追加,查找,删除等)
  2. Python用urlib爬虫基础及格式入门
  3. android中的xml布局文件如何引用另一个xml布局文件,引用另一个layout.xml文件而不复制它...
  4. 屏幕小于6英寸的手机_vivo新机成最轻薄手机?6.56英寸屏幕,重量仅178g
  5. D-News|英特尔首推融合现实,亚马逊云服务市场占比超3成
  6. jersey2.22.2异常java.lang.NoSuchMethodError: org.glassfish.jersey.CommonProperties.getValue
  7. andorid 回调的理解
  8. python之路 mysql 博客园_python之路--MySQL数据库初识
  9. “ORA-01747: user.table.column, table.column 或列说明无效” 的解决方案
  10. Codeforces Round #524 (Div. 2) Masha and two friends
  11. myeclipse修改maven settings
  12. 【AD】Altium Designer 原理图的绘制
  13. python八大排序算法_Python实现八大排序算法
  14. 【你了解什么是算法设计与分析吗?】
  15. 申请手册:英国百所大学中文名称及网址
  16. python解二元方程组_Python 解线性方程组
  17. 三星typec转接耳机没反应_1MORE最新双旗舰无线降噪耳机评测:国货强于外夷的希望...
  18. 使用lua脚本开发wow插件(魔兽世界插件开发)
  19. [保姆级教程] 从原理到应用,超级详细的MPU6050传感器整理,看完这一篇就够了
  20. Android 最新实现沉浸式状态栏的效果

热门文章

  1. TIA博途_HMI触摸屏报警记录功能的使用方法示例
  2. Python+Vue计算机毕业设计漫语在线论坛设计与实现5i5u1(源码+程序+LW+部署)
  3. 世界最快固态硬盘CFD M2OPG1VN开卖:2500MB/s
  4. NLPIR.user Not valid license or your license expired! Please feel free to contact pipy_zhang@msn.com
  5. python 环境隔离 virtualenv workon设置环境变量mac windows
  6. 信息茧房时代,产品经理如何升级打怪
  7. 关于举办大数据建模、分析、挖掘技术应用直播课程研修班
  8. Cinder-volume源码解析
  9. Intellij Idea 团队协同开发必备配置
  10. 什么是事务?事务的作用是什么?(面试题)