小编bil*_*bil的帖子

这段代码如何在碱基之间转换?

#include<stdio.h>
#include<string.h>
void baseconversion(char s[20], int, int);
main()
{   
    char s[20];
    int base1, base2;
    printf("Enter the number and base:");
    scanf("%s%d", s, &base1);
    printf("Enter the base to be converted:");
    scanf("%d", &base2);
    baseconversion(s, base1, base2);
}

void baseconversion(char s[20], int b1, int b2)
{
    int count = 0, r, digit, i, n = 0, b = 1;
    for(i = strlen(s) - 1; i >= 0; i--)
    {
        if(s[i] >= 'A' && s[i] <= 'Z')
        {
            digit = s[i] - '0' - 7; …
Run Code Online (Sandbox Code Playgroud)

c converters

1
推荐指数
1
解决办法
57
查看次数

标签 统计

c ×1

converters ×1