FZU 2089 数字游戏
2013-11-05 19:30
218 查看
FZU 2089 数字游戏 题目连接:http://acm.fzu.edu.cn/problem.php?pid=2089
水
题目分析:大数,long long可解。
code:
PS:linux下大数很奇葩,自己测试时定义long long,输入用的%lld,能运行;用%I64d,报如下错误:
提交则相反,用%lld交,wrong;用%I64d,A了……这是怎么一回事??
水
题目分析:大数,long long可解。
code:
#include<stdio.h> int main() { int i,t,count; long long a,b,sum; scanf("%d",&t); while(t--) { scanf("%I64d%I64d",&a,&b); sum=a+b; count=0; while(sum) { count+=sum%10==5?1:0; sum/=10; } printf("%d\n",count); } return 0; }
PS:linux下大数很奇葩,自己测试时定义long long,输入用的%lld,能运行;用%I64d,报如下错误:
/shiziyouxi.cpp|9|警告: 格式 ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat]| /shiziyouxi.cpp|9|警告: 格式 ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long int*’ [-Wformat]| ||=== Build finished: 2 errors, 0 warnings ===|
提交则相反,用%lld交,wrong;用%I64d,A了……这是怎么一回事??
相关文章推荐
- 过路费 FZU - 2082 (树链剖分-点更-区间查)
- G - 翻翻棋 FZU - 2230
- FZU 2203 单纵大法好 (二分+贪心)
- FZU1683---纪念SlingShot(矩阵快速幂(数据劣质))
- FZU 2254 英语考试 (最小生成树)(福州大学第十四届程序设计竞赛)
- Fzu 2261 浪里个浪【思维+最短路】
- FZU 2271 X (Floyd)(第七届福建省大学生程序设计竞赛)
- 第七届福建省赛 FZU 2267 The Bigger the Better(贪心 后缀数组)
- FZU oj 2277 Change 树状数组+dfs序
- FZU 2272 Frog 第八届福建省赛 (鸡兔同笼水题)
- FZU 2109 奇偶
- fzu 2278 YYS 数学
- FZU - 2254 英语考试
- FZU 2205 据说题目很水
- FZU 2150 Fire Game
- FZU 2282 错排
- FZU 2278 期望
- Two Triangles FZU - 2270
- FZU-2192 位置信息挖掘
- FZU 2280 Magic