POJ_1002_487-3279
2016-08-27 09:11
363 查看
#include<cstdio> #include<cstdlib> #include<cctype> #include<map> using namespace std; int main(){ int n, num, flag; char str[300], ch; map<int, int> counts; map<int, int>::iterator it; scanf("%d", &n); while (n--){ num = 0; scanf("%s", str); for (int j = 0, k = 0; j < 7; k++){ ch = str[k]; if (isdigit(ch)){ j++; num = num * 10 + ch - '0'; } else if (isupper(ch)){ j++; num = num * 10 + (ch - 'A' - (ch > 'Q')) / 3 + 2; } } counts[num]++; } flag = 0; for (it = counts.begin(); it != counts.end(); it++){ if (it->second > 1){ printf("%03d-%04d %d\n", it->first / 10000, it->first % 10000, it->second); flag = 1; } } if (flag == 0) printf("No duplicates.\n"); return 0; }
相关文章推荐
- POJ 1002 487-3279
- POJ1002 487-3279
- poj 1002 487-3279 AC代码
- poj1002 487-3279 ——水题
- POJ1002 487-3279
- 【poj1002】487-3279 题解&代码(c++)
- zoj 1159 || poj 1002 487-3279
- poj 1002 487-3279
- POJ[1002]487-3279
- poj 1002:487-3279(水题,提高题 / hash)
- poj 1002 487-3279(map)
- C -- POJ 1002 487-3279
- POJ 1002 487-3279
- POJ 1002 487-3279 与二维数组的快速排序
- poj每日一题之1002(487-3279)
- POJ 1002 487-3279 (模拟 水题)
- POJ 1002 487-3279(map映照容器的使用)
- poj - 1002 - 487-3279
- OpenJudge / POJ 1002 487-3279 解题报告 C++
- POJ--1002--487-3279