Tuesday, May 3, 2011

10878 - Decode the tape


#include<stdio.h>
int main()
{
    char ch[12];
    int let=0,i=0,ascii[11]={0,0,64,32,16,8,0,4,2,1,0};
    //freopen("in.txt","r",stdin);
    while(gets(ch))
    {
        let=0;
        for(i=2;i<10;i++)
            if(ch[i]=='o')
                let=let+ascii[i];
        if(let)printf("%c",let);
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.