标签:info style printf loading char span sum http mic
1 #include<stdio.h> 2 3 int main(){ 4 char str[10][5] = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"}; 5 char num[100]; 6 int sum = 0, i = 0; 7 scanf("%s",&num); 8 for(i = 0; i < 100; i++){ 9 if(num[i] >= ‘0‘ && num[i] <= ‘9‘){ 10 sum += num[i] - ‘0‘; 11 } 12 if(num[i]==‘\0‘) break; 13 } 14 15 // printf("%d\n",sum); 16 int a1 = sum / 1 % 10; 17 int a2 = sum / 10 % 10; 18 int a3 = sum / 100 % 10; 19 20 if(a3 != 0) printf("%s ",str[a3]); 21 if(a2 != 0) printf("%s ",str[a2]); 22 if(a1 != 0) printf("%s",str[a1]); 23 return 0; 24 }
标签:info style printf loading char span sum http mic
原文地址:https://www.cnblogs.com/SCP-514/p/13190949.html