shiningrise
#include<iostream>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include <math.h>

using namespace std;
int a;
char b[100];
float s;
int main(){
    scanf("%d %s",&a,b);
    //printf("%s\n",b);
    int len = strlen(b);
    s= 0;
    for(int i = 2 ; i < len ; i++)
    {
        int t = 0;
        if(b[i] >= \'A\')
            t = b[i] -\'A\' + 10;
        else
            t = b[i] - \'0\';
            
        s += pow(a,-i+1) * t;
    }
    s *= 10000;
    s = floor(s + 0.5);
    s /= 10000;
    printf("%0.4f\n",s);
    //printf("%s\n",a);
    return 0;
}

 

分类:

技术点:

相关文章:

  • 2021-05-18
  • 2021-07-30
  • 2021-11-27
  • 2021-11-23
  • 2021-10-27
  • 2022-12-23
  • 2021-06-18
  • 2022-01-02
猜你喜欢
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2021-10-20
  • 2021-12-05
相关资源
相似解决方案