深信服笔试(测试开发)第一题

#include<bits/stdc++.h>
using namespace std;

int main(){
string str="";
int num;
while(cin>>str>>num){
int len=str.size();
for(int i=0;i<len;i++){
if(str[i]<'0'||str[i]>'9'){
cout<<"error"<<endl;
return 0;
}
}
if(len!=8)cout<<"error"<<endl;
else if(num>8||num<1)cout<<"error"<<endl;    //三种情况返回error
else{
swap(str[num-1],str[7]);
//cout<<str<<endl;
str.erase(7);         //将要删除元素放到最后并删除
//cout<<str<<endl;
for(int i=1;i<=7;i++){
for(int j=1;j<=7-i;j++){
if(str[j-1]<str[j]){
swap(str[j-1],str[j]);
//cout<<str<<endl;
}

}
}
for(int i=0;i<7;i++)
cout<<str[i];
}

}
}

#深信服##笔试题目#
全部评论
楼主测开啥时候收到的笔试
点赞 回复 分享
发布于 2020-09-09 22:19
楼主请问,深信服软件测试都有什么题型啊,编程语言有限制吗?
点赞 回复 分享
发布于 2020-09-09 22:02
完了。。。。我只会python啊 。。。还必须用C语言啊
点赞 回复 分享
发布于 2020-09-09 21:44
请问只能用c++吗
点赞 回复 分享
发布于 2020-05-26 14:47
楼主,测试有填空,选择题么
点赞 回复 分享
发布于 2020-05-26 10:04

相关推荐

08-01 17:57
门头沟学院 Java
点赞 评论 收藏
分享
程序员小白条:这比例牛逼,750:1
点赞 评论 收藏
分享
07-28 00:10
已编辑
门头沟学院 算法工程师
码农索隆:这哥们库库在我帖子下评论
点赞 评论 收藏
分享
评论
5
5
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务