错误票据test
本文最后更新于 1803 天前,其中的信息可能已经有所发展或是发生改变。
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;

int main(){
	int n;
	vector<string> vec;
	vector<string> vecarr;
	cin>>n;
	cin.ignore();
	for(int i=0;i<n;i++){
		string s;
		getline(cin,s);
		vec.push_back(s);
	}
	for(int i=0;i<vec.size();i++){
		//cout<<vec[i]<<endl;
		string s=vec[i];
		string temp="";
		for(int j=0;j<s.length();j++){
			if(s[j]==' '){
				vecarr.push_back(temp);
				temp="";
			}else
			temp+=s[j];
		}
		vecarr.push_back(temp);
	}
	vector<int> intarr;
	for(int j=0;j<vecarr.size();j++){
		string temp=vecarr[j];
		int inttemp=0,k=0;
		int len=temp.length();
		while(k<len){
			inttemp+=(temp[k]-'0')*pow(10,len-k-1);
			k++;			
		}
		intarr.push_back(inttemp);
	}
	sort(intarr.begin(),intarr.end());
	int c,d;
	for(int i=1;i<intarr.size();i++){
		if(intarr[i]-intarr[i-1]==2){
			c=intarr[i]-1;
		}else if(intarr[i]-intarr[i-1]==0){
			d=intarr[i];
		}
	} 
	cout<<c<<" "<<d;
	return 0;
}
作者:Yuyy
博客:https://yuyy.info
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇