#include<stdio.h>
#include<string.h>
//八进制转十进制
int main()
{
char s[6],*p = s;
int n;
gets(p);
n = *p-'0'; //把字符型数字转化成数值型数字的方法
while(*++p)
// while(*++p!='') //在数组中字符串的结束是以''(它的ASCII是0)结尾的,这里是来判断是否到尾.
n = n * 8 + *p -'0';
printf("%dn",n);
return 0;
}
最后
以上就是鲜艳衬衫最近收集整理的关于C语言:八进制转十进制的全部内容,更多相关C语言内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复