PAT甲1005,大佬帮忙看下哪里错了,看网大多使用输入字符串来解答。。。。 - 爱问答

(爱问答)

PAT甲1005,大佬帮忙看下哪里错了,看网大多使用输入字符串来解答。。。。

#include <stdio.h>

#include <stdlib.h>

 

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

 

int main(int argc, char *argv[]) {

    long int N,temp,sum=0,counter=0;

char *S[10]={"zero","one","two","three","four","five","six","seven","eight","nine"};

scanf("%ld",&N);

while(N%10){

sum+=N%10;

N=N/10;

}

//printf("%ld",sum);

temp=sum;

while(temp=temp/10) counter++;

//printf("%d",counter);

 

    while(counter>0){

printf("%s ",S[sum/(counter*10)]);

sum=sum%(counter*10);

counter--;  

}

printf("%s ",S[sum]);

 

return 0;

}


PAT甲1005,大佬帮忙看下哪里错了,看网大多使用输入字符串来解答。。。。


你要把题目出处或详细的要求贴出来

单单程序没有要求是无法判断程序的正确性的

下一篇:求flstudio12.5注册机非真勿扰

上一篇:解决问题

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?