文章
21
粉丝
0
获赞
6
访问
1.5k
数字嘉陵变字符,字符数减零变数字
#include <stdio.h>
#include <string.h>
#include<iostream>
using namespace std;
int main() {
int n;
int temp;
while(cin>>n){
char ans[200000];
int k=0;
temp=n;
while(temp>0){
ans[k++]=(temp%8)+'0';//数字嘉陵变字符,字符数减零变数字
temp=temp/8;
}
for(int i=k-1;i>=0;i--){
cout<<ans[i];
}
cout<<endl;
}
return 0...
登录后发布评论
暂无评论,来抢沙发