#include <stdio.h>#include <string.h>int main (void){ char a[1000]; int l,i; while(scanf("%s",a)!=EOF) { if(a[0]=='0') break; l=strlen(a); if(l==1) { printf("%c\n",a[0]); continue; } for(i=0;i<l-1;i++) { a[l-1]+=a[i]-48; if(a[l-1]>57) a[l-1]-=9; } printf("%d\n",a[l-1]-48); } return 0;}
详细解决方案
HDU-1013-Digital Roots
热度:7053 发布时间:2013-02-26 00:00:00.0
相关解决方案
- HDU-1013-Digital Roots
- [Arduino课程3] Digital Read Serial-从串口读取数字信号
- What is a Digital Signature
- [求助]E=pv/(k-1)(1-(0.1013/p)^((k-1)/k))*10^3
- HDU 1013.Digital Roots【模拟或数论】【八月份16】
- HDU 1013 Digital Roots (简略题_大数)
- HDU 1163 Eddy's digital Roots(9余数定理+快速幂)
- hdoj-1163-Eddy's digital Roots【9余数定理】
- 1022. Digital Library (30) -地图 -字符串处理
- HDOJ 标题4394 Digital Square(DFS)
- 杭电 1013 digital roots 错哪了
- HDU 1013Digital Roots 吃完饭,水个题
- Codeforces Round #282 (Div. 二)-A. Digital Counter
- 安装QC出现异常 : This file has no digital signature or the publisher is untrusted
- poj 3112 Digital Biochemist Circuit(简略题)
- Codeforces Round #248 (Div. 一)——Nanami's Digital Board
- HDU 1013 Digital Roots 例题
- Codeforces 10C Digital Root 法令题
- hdu 1163 Eddy's digital Roots(9余数定理)
- Pat(Advanced Level)Practice-1022(Digital Library)
- HDOJ - 1013 - Digital Roots(字符串、范畴)
- 1013. 数素数 (20) PAT
- 题目1124:Digital Roots 九度OJ
- PAT甲级-1022 Digital Library (30分)
- PAT甲级-1013 Battle Over Cities (25分)
- PAT乙级-1013 数素数 (20分)
- Java - PAT - 1013. 数素数 (20) 注意超时
- .Net Core 2.2.6安装sfx_86.cab has an invalid digital signature错误解决方案
- LeetCode—— 1013 将数组分成和相等的三部分
- DAI:Digital Audio Interfaces(音频设备的硬件接口)