Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大牛帮忙看看#include<iostream.h> void main () { char c[19]; int i=0,j,a[19]; while(c[i]=cin.get()) { switch(c[i]) { case 'B': case 'F': case 'P': case 'V': a[i]=1;{break;} case 'C': case 'G': case 'J': case 'K': case 'Q': case 'S': case 'X': case 'Z': a[i]=2;{break;} case 'D': case 'T': a[i]=3;{break;} case 'L': a[i]=4;{break;} case 'M': case 'N': a[i]=5;{break;} case 'R': a[i]=6;{break;} default: a[i]=7; } if(c[i]=='\n') {break;} ++i; } if(a[0]!=7) {cout<<a[0];} else { for(j=1;j<=i;++j) { if(a[j]!=a[j-1]&&a[j]!=7) {cout<<a[j];} } } cout<<endl; cin>>i; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator