poj1002
来源:互联网 发布:淘宝怎么看付款顺序 编辑:程序博客网 时间:2024/06/05 16:07
#include <iostream>#include<cstdio>#include<algorithm>#include<string.h>#include<queue>using namespace std;int n,t,num;char s[300],c[30]="2223334445556667777888999";int main(){ while(~scanf("%d",&n)) { priority_queue<int, vector<int>, greater<int> > st; while(n--) { scanf("%s",s); t=0; int len=strlen(s); for(int i=0;i<len;i++) { if(s[i]!='-') { if(s[i]>='0'&&s[i]<='9') t=t*10+s[i]-'0'; else t=t*10+c[s[i]-'A']-'0'; } } st.push(t); } int flag=0; while(!st.empty()) { t=st.top(); st.pop(); num=1; while(!st.empty()&&t==st.top()) { num++; st.pop(); } if(num>1) { printf("%03d-%04d %d\n",t/10000,t%10000,num); flag=1; } } if(flag==0) printf("No duplicates.\n"); } return 0;}简单题
0 0
- POJ1002
- POJ1002
- poj1002
- poj1002
- poj1002
- poj1002
- poj1002
- POJ1002
- poj1002
- POJ1002
- POJ1002
- POJ1002
- poj1002
- POJ1002
- POJ1002
- poj1002
- poj1002
- POJ1002
- 只要不是终点,就请微笑向前——学年总结
- 谋哥:玩移动互联网首先就是要活下去
- ubuntu14.04安装chromium不能播放电影
- C++设计模式之外观模式(二)
- Mysql常用函数
- poj1002
- java学习笔记之IO流
- shell笔记一:认识shell
- 工作流的概念(1)
- 《Effective C++》学习笔记(八)
- poj1002
- iOS开源项目搜集
- 2.3.2.1 使用高阶函数扩展词汇
- KMP