cvte笔试题
来源:互联网 发布:gps导航软件下载 编辑:程序博客网 时间:2024/05/18 01:00
cvte技术支持笔试题
20个不定选择,一共90分钟
1 在一个字符串中找到第一个只出现一次的字符。
如输入”abaccdeff”,输出’b’
如果都出现多次,则输出输入次数最多的那个
char FirstNotRepeatChar(string s) { int size = s.length(); if (size == 0) return '\0'; const int M = 255; // 表大小,char :1 Byte,0~255 int[] count=new int[M]; for (int i = 0; i < M; i++) count[i] = 0; for (int j = 0; j < size; j++) count[s[j]-'\0']++; char result; for (int i = 0; i < size; i++) { if (count[s[i]-'\0'] == 1) { result = s[i]; break; } } delete []count; return result;}int main() { string s = "testonline"; cout << FirstNotRepeatChar(s) << endl;}
2以单词为单位的逆序排序
输入:hello world
输出: world hello
#include <stdio.h>#include <string.h>int main(){char s[3000],c[1000][20]={0};//c[j]来储存单词,k是单词中的字母int i,j=0,k=0;gets(s);for(i=0; i<strlen(s); i++){if(s[i]==' '){j++; //遇空格换下一个单词,k归零k=0;continue;}c[j][k]=s[i];k++;}for(i=j; i>=0; i--)//逆序输出printf("%s ",c[i]);}
阅读全文
0 0
- CVTE笔试题
- CVTE笔试题
- CVTE笔试题
- CVTE水果笔试题
- CVTE笔试题
- cvte笔试题
- 链家、CVTE笔试题
- cvte笔试题
- CVTE 嵌入式软件工程师 笔试题
- 2016 CVTE 笔试编程题
- 【CVTE笔试题】数字分割
- C++笔试题(二).CVTE
- CVTE笔试
- CVTE笔试题---字符串的全排列
- 2016CVTE春招笔试编程题
- CVTE 2018 Android在线笔试编程题
- 2016CVTE校招在线笔试题
- 广州CVTE公司笔试程序题
- 安卓app开发遇到的问题以及解决方法
- es6 let与constant命令
- 【译】唯快不破:Web 应用的 13 个优化步骤
- Java中final关键字对基本类型和引用的差别
- DataX配置和性能调优
- cvte笔试题
- [Struts2] 文件上传和下载
- HDU 5676 ztr loves lucky numbers
- c++中的构造函数注意事项
- hive计算map数和reduce数
- [Struts2] 值栈
- 【Array】数组删除最后一个元素;
- 最长递增子序列长度(动态规划)
- 牛客 题库 6 堆栈