错误票据
本文最后更新于 2181 天前,其中的信息可能已经有所发展或是发生改变。
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
vector<string> v;
vector<int> vc;
int str2int(string s){
	int res=0;
	int len = s.length();
	for(int i=0;i<len;i++){
		res += (s[i]-'0')*pow(10,len-i-1);
	}
	return res;
}
int main(){
	string s;
	int n;
	cin>>n;
	int m=n;
	cin.ignore();
	while(n--){
		getline(cin,s);
		v.push_back(s);
	}
	
	for(int i=0;i<m;i++){
		string temp = v[i];string str="";
		for(int j=0;j<temp.length();j++){
			/*if(j==temp.length()-1){
				if(temp[j]==' ')
					vc.push_back(str2int(str));
				else 
			}*/
			if(temp[j]==' '){				
				vc.push_back(str2int(str));
					str="";
			}
			else{
				str+=temp[j]; 			
			}
			
			
		}
		vc.push_back(str2int(str));
	}
	sort(vc.begin(),vc.end());
	int dID,cID;int f=vc[0];
	for(int i=1;i<vc.size();i++){
		
		if(vc[i]-vc[i-1]==2)
			dID = vc[i]-1;
		else if((vc[i]==vc[i-1]))
			cID = vc[i]; 
	}
	cout<<dID<<" "<<cID<<endl;
	return 0;
}
作者:Yuyy
博客:https://yuyy.info
暂无评论

发送评论 编辑评论


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