NYOJ 105 九的余数
2012-08-19 09:31
239 查看
地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=105
思路:大数求余,同NYOJ 205 求余数
思路:大数求余,同NYOJ 205 求余数
#include<stdio.h> #include<string.h> char num[1000100]; int main() { long int i; int n,temp,t; scanf("%d",&n); while(n--) { scanf("%s",num); t=strlen(num); for(temp=0,i=0;i<t;i++) temp=(temp*10+num[i]-'0')%9; printf("%d\n",temp%9); } return 0; }
相关文章推荐
- nyoj 105 九的余数(大数除小数) 水题
- NYOJ-105-九的余数(数论)
- nyoj 105 九的余数
- 大数取余解析[以NYoj 105 九的余数 为例]
- nyoj--105--九的余数(水题)
- Nyoj 105 九的余数
- nyoj--105--九的余数(水题)
- NYOJ-题目(Math)--105--------------------------------九的余数
- 【NYOJ - 105】九的余数
- nyoj105 九的余数
- NYOJ 105 九的余数【数学】
- NYOJ 105 九的余数
- NYOJ 105 九的余数
- nyoj 105 九的余数
- NYOJ 105 9的余数
- NYOJ 105 九的余数
- nyoj 105 九的余数
- nyoj-105-九的余数
- nyoj 105 九的余数
- NYOJ 105 九的余数