1.代码:#include<stdio.h>
int main ()
{
int n, initial_n;
scanf("%d", &n);
initial_n = n;
char num[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
char unit[10] = {0, 0, 'S', 'B', 'Q', 'W', 'S', 'B', 'Q', 'Y'};
char result[17]={0};
int i, last_i = n % 10;
int j = 0;
int count_n = 0;
while (n > 0) {
i = n % 10;
n /= 10;
count_n ++;
if (i == 0 && (count_n % 4) > 1) {
if (last_i != 0) {
result[j++] = num[i];
}
}
if (count_n == 5 && i == 0 && initial_n < 100000000) {
result[j++] = unit[count_n];
}
if (count_n > 1 && i != 0) {
result[j++] = unit[count_n];
}
if (i != 0) {
result[j++] = num[i];
}
last_i = i;
}
if (initial_n == 0) {
result[j++] = num[i];
}
for (j=j-1; j>=0; j--) {
printf("%c", result[j]);
}
printf("\n");
return 0;
}
2.问题与方法
看到这个题目是懵了,后来思考后只想到了要考虑"0",数组还没想到,也不知道该怎么创建、使用,代码是别人教的,流程图也是看着代码一步步画的,但是具体的我还是不懂
3.运行编辑图
000000000
4.流程图