zoj 3406 Another Very Easy Task
来源:互联网 发布:高分一号数据波段运算 编辑:程序博客网 时间:2024/06/15 01:27
点击打开题目链接
This task is so easy that the description is omitted.
Sample Input
A numeronym is a number-based word.Most commonly, a numeronym is a word where a number is used to form anabbreviation (albeit not an acronym or an initialism). Pronouncing theletters and numbers may sound similar to the full word: "K9" for "canine"(phonetically: "kay" + "nine"). A similar example in French is "K7" for"cassette" (phonetically: "ka" + "sept").Alternatively, the letters between the first and last are replaced by anumber representing the number of letters omitted, such as "i18n" for"internationalization". Sometimes the last letter will also be countedand omitted.According to Tex Texin, the first numeronym of this kind was "S12n", theelectronic mail account name given to DEC employee Jan Scherpenhuizen bya system administrator because his surname was too long to be an accountname. Colleagues who found Jan's name unpronounceable often referred tohim verbally as "S12n". The use of such numeronyms became part of DECcorporate culture.
Sample Output
A n7m is a n4r-b3d w2d.M2t c6y, a n7m is a w2d w3e a n4r is u2d to f2m ana10n (a4t n1t an a5m or an i8m). P9g t1el5s a1d n5s m1y s3d s5r to t1e f2l w2d: "K9" f1r "c4e"(p10y: "k1y" + "n2e"). A s5r e5e in F4h is "K7" f1r"c6e" (p10y: "ka" + "s2t").A11y, t1e l5s b5n t1e f3t a1d l2t a1e r6d by an4r r10g t1e n4r of l5s o5d, s2h as "i18n" f1r"i18n". S7s t1e l2t l4r w2l a2o be c5da1d o5d.A7g to T1x T3n, t1e f3t n7m of t2s k2d w1s "S12n", t1ee8c m2l a5t n2e g3n to D1C e6e J1n S12n bya s4m a11r b5e h1s s5e w1s t1o l2g to be an a5tn2e. C8s w1o f3d J1n's n2e u13e o3n r6d toh1m v6y as "S12n". T1e u1e of s2h n8s b4e p2t of D1Cc7e c5e.
一打眼,字符串,吓了一跳,还以为很难呢,结果很水,就是把连起来的2个以上的英文字母,
除了头和尾中间只剩下字母个数,特别注意:数字或其他字符是不处理的!不要想多奥~
另外,必须用gets输入,其他的不能接受空格,会多出很多换行
#include<iostream>#include<cmath>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){ char a[10010]; int i,j,k; while(gets(a)!=NULL) { // printf("%s\n",a); int t=strlen(a); int tt=0,flag=0; for(i=0;i<t;i++) { if((a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z')&&!flag) { printf("%c",a[i]); flag=1; } else if((a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z')&&flag==1) { if(a[i+1]>='a'&&a[i+1]<='z'||a[i+1]>='A'&&a[i+1]<='Z') tt++; else { if(tt>0) printf("%d",tt); printf("%c",a[i]); tt=0; flag=0; } } else { printf("%c",a[i]); flag=0; tt=0; } } printf("\n"); } return 0;}
0 0
- ZOJ 3406 Another Very Easy Task
- zoj 3406 Another Very Easy Task
- Another Very Easy Task
- Another Very Easy Task 我也不知道怎么会过不了?
- ZOJ 2969 Easy Task
- ZOJ 3844 Easy Task
- zoj 3844 easy task
- ZOJ 2969 Easy Task
- ZOJ 3844Easy Task
- ZOJ 2969 Easy Task
- ZOJ :: Easy Task
- ZOJ 2969Easy Task
- zoj 3844 Easy Task(水题)
- ZOJ 2969 && BNU16488 Easy Task
- 哈希--ZOJ - 3844 Easy Task
- ZOJ 3844Easy Task(暴力)
- [简单数学]ZOJ 2969 Easy Task
- ZOJ 2969 Easy Task(模拟)
- GetIntFromHex
- 关于虚函数
- Kinect开发教程三:利用OpenNI进行手势识别
- 创业者易犯的19个容易忽略却能创造奇迹的小错误
- Eclipse 代码修改后仍然是之前的运行结果
- zoj 3406 Another Very Easy Task
- 中断申请函数request_irq详解
- [ACM] hdu 2717 Catch That Cow (BFS)
- C# Winform中如何实现窗体之…
- 遍历Map方法二(用到Map.Entry内部类)
- 转: 如何部署DevExpress控件
- DevExpress界面控件介绍
- 记录 record
- computer science and technology