POJ 1002(字符串处理)
来源:互联网 发布:最大熵模型 python 编辑:程序博客网 时间:2024/06/08 10:36
这题就是字符串处理
Program P1002;Type phone=record num,s:longint; end;var n,i,j,p:Longint; b:boolean; s:ansistring; a:array[0..9999999] of longint;// f:array[1..100000] of phone; ch:array['A'..'Z'] of longint=(2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,-1,7,7,8,8,8,9,9,9,-1);function isdight(c:char):longint;var i,j,p:longint;begin p:=ord(c); if (48<=p) and (p<58) then exit(p-48); if (65<=p) and (p<=90) then begin if ch[c]<>-1 then exit(ch[c]); end; exit(-1);end;function hash:longint;var i,j,p:longint;begin j:=0; hash:=0; for i:=1 to length(s) do begin if s[i]='-' then continue; p:=isdight(s[i]); if (p=-1) or ((p<>-1) and (j=7)) then exit(-1); hash:=hash*10+p; inc(j); end; if j<>7 then exit(-1);end;procedure pri(p:longint);var i,j:longint;begin b:=true; i:=p div 10000; j:=p mod 10000; if i<100 then write('0'); if i<10 then write('0'); write(i,'-'); if j<1000 then write('0'); if j<100 then write('0'); if j<10 then write('0'); writeln(j,' ',a[p]);end;Begin b:=false; readln(n); fillchar(a,sizeof(a),0); for i:=1 to n do begin readln(s); p:=hash; if p=-1 then continue else inc(a[p]); end; for i:=0 to 9999999 do if a[i]>1 then pri(i); if not(b) then writeln('No duplicates.');End.
- POJ 1002(字符串处理)
- POJ 1002 电话号码字符串处理
- poj 1002 电话号码\字符串处理
- POj 1580(字符串处理)
- POJ 1002 487-3279 字符串处理
- POJ 1750 Dictionary (字符串处理)
- poj 1035 Spell checker(字符串处理)
- POJ 1035 Spell checker(字符串处理)
- POJ 2256 Artificial Intelligence?(字符串处理)
- POJ: Surprising Strings(map、字符串处理)
- POJ 1575 (字符串处理)
- poj 1035 字符串处理
- poj 2895-字符串的处理
- POJ 1068 Parencodings (字符串处理)
- POJ 2271 HTML (字符串处理)
- POJ 1002(不用排序的方法)(简单的字符串处理程序)
- poj 1002 方便记忆的电话号码 字符串处理+排序
- POJ 1016 Numbers That Count(字符串处理)
- HTTP权威指南(国内首本HTTP及其相关核心Web技术权威著作)
- [Android实例] ViewPager多页面滑动切换以及动画效果
- Mysql中存取以及显示中文字符的问题
- 项目编译时中文乱码解决
- 计算机术语中关于 Assert 和De-assert 词汇意思
- POJ 1002(字符串处理)
- git 忽略跟踪工程文件
- 有关指针
- myeclipse优化
- void assert (int expression)
- HDU 2999 Stone Game, Why are you always there? (构造 SG函数)
- Eclipse 中 工程 引用 其他 工程的 配置方法。
- android listview实现快速查询A—Z (模拟一些天气搜狐,网易等天气预报)
- java数据结构学习(一)