hdu-1013-Digital Roots
来源:互联网 发布:吉视传媒网络宽带连接 编辑:程序博客网 时间:2024/06/06 06:44
#include<stdio.h>
#include<string.h>
char a[1005];
int main()
{
int n,s,i;
while(scanf("%s",a)&&a[0]!='0')
{
n=strlen(a);
s=0;
for(i=0;i<n;i++)
s+=a[i]-48;
s%=9;
if(s==0)
printf("9\n");
else
printf("%d\n",s);
}
return 0;
}
#include<string.h>
char a[1005];
int main()
{
int n,s,i;
while(scanf("%s",a)&&a[0]!='0')
{
n=strlen(a);
s=0;
for(i=0;i<n;i++)
s+=a[i]-48;
s%=9;
if(s==0)
printf("9\n");
else
printf("%d\n",s);
}
return 0;
}
- HDU 1013 Digital Roots
- HDU 1013 Digital Roots
- hdu 1013 Digital Roots
- HDU 1013 Digital Roots
- HDU 1013 Digital Roots
- HDU 1013 Digital Roots
- hdu 1013 Digital Roots
- HDU 1013 Digital Roots
- hdu 1013 Digital Roots
- HDU--1013--Digital Roots
- hdu 1013 Digital Roots
- hdu 1013 Digital Roots
- HDU 1013Digital Roots
- HDU 1013 Digital Roots
- hdu 1013 Digital Roots
- hdu 1013 Digital Roots
- Digital Roots hdu 1013
- HDU 1013 Digital Roots
- Sqlserver表类型和表变量
- SQL_Server_2005_日期和时间函数(描述及实例) (转)
- Visual Studio 无法输入中文
- C++ 操作sqlite3数据库
- 动态分配和释放二维数组
- hdu-1013-Digital Roots
- C#调用非托管C++DLL中的函数
- nginx location常用语法
- UIApplication sharedApplication详细解释-IOS
- jquery 查询元素技巧
- Google中国2014校园招聘笔试Round A China New Grad Test Problem B. Rational Number Tree
- dwr框架报SecurityException异常的一个可能原因:类加载问题
- 数据结构与算法B代码编写作业,字符串插入,解题报告&AC代码
- poj 1244 Slots of Fun