#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <string.h>
using namespace std;

int main()
{
    char  p[1024];
    cin>>p;
    int len = strlen(p);
    int i,j;
    unsigned val;
    long long  sum =0;
    int k = 0;
    for(i = len-1; i>=0; i--)
    {
            for(j = 0; j<8; j++)
            {
                    val = p[i]>>j;
                    val&=0x01;
                    sum = sum +val*pow(2,k);
                    k++;
            }
    }
    cout<<sum<<endl;
    return 0;
}

 

相关文章:

  • 2021-09-07
  • 2021-10-19
  • 2021-12-12
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-12-25
  • 2021-10-19
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案