poj2608

简单题

View Code
   
     
#include < iostream >
#include
< cstdio >
#include
< cstdlib >
#include
< cstring >
using namespace std;

int
s[]
=
{
0 , 1 , 2 , 3 , 0 , 1 , 2 , 0 , 0 , 2 , 2 , 4 , 5 , 5 , 0 , 1 , 2 , 6 , 2 , 3 , 0 , 1 , 0 ,
2 , 0 , 2 };

int main()
{
// freopen("t.txt", "r", stdin);
string st;
while (getline(cin, st))
{
int p = 0 ;
while (s[st[p] - ' A ' ] == 0 )
p
++ ;
while (p < st.length())
{
if (s[st[p] - ' A ' ] != s[st[p - 1 ] - ' A ' ] && s[st[p] - ' A ' ] != 0 )
printf(
" %d " , s[st[p] - ' A ' ]);
p
++ ;
}
printf(
" \n " );
}
return 0 ;
}

你可能感兴趣的:(poj)