八进制转换为十进制
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include<stdio.h> #include<stdlib.h> int main() { int n=0,i=0; char s[20]; printf("please input a Octal :\n"); gets(s); while(s[i]!='\0'){ n=n*8+s[i]-'0'; i++; } printf("changed to decimal\n%d\n",n); return 0; } |
除教程外,本网站大部分文章来自互联网,如果有内容冒犯到你,请联系我们删除!