[PAT] 1001A+B Format (20)
来源:互联网 发布:vlc mac 编辑:程序博客网 时间:2024/06/06 02:47
题意是求给出两个数的和,按三位一个逗号的格式输出
//已AC代码#include<bits/stdc++.h>using namespace std;int main(){ int a,b; while(~scanf("%d%d",&a,&b)) { int sum; sum=a+b; if(sum<0) { printf("-"); sum=-sum; } if(sum>=1000000) { printf("%d,%03d,%03d\n",sum/1000000,(sum/1000)%1000,sum%1000); } else if(sum>=1000) { printf("%d,%03d\n",(sum/1000)%1000,sum%1000); } else { printf("%d\n",sum); } }}
阅读全文
0 0
- [PAT]1001 A+B Format (20)
- [PAT] 1001A+B Format (20)
- PAT 1001 A+B Format (20)
- PAT 1001 A+B Format
- pat 1001 A+B Format
- PAT 1001 A+B Format
- PAT 1001 A+B Format
- PAT A 1001 A+B Format
- PAT(A-LEVEL) 1001 A+B Format
- PAT A 1001. A+B Format (20)
- PAT-A-1001. A+B Format (20)
- PAT A 1001. A+B Format (20)
- PAT-A 1001. A+B Format (20)
- PAT-A 1001. A+B Format (20)
- Pat(A) 1001. A+B Format (20)
- PAT-A 1001. A+B Format (20)
- 浙大PAT (Advanced Level) Practise 1001 A+B Format (20)
- PAT (Advanced Level) Practise 1001 A+B Format (20)
- 有用的URL,大量的干货!!!!!!!!!!!!
- 严蔚敏版数据结构课本代码——链表结构实现算法2.2(BUCT-JK1602-LLP)
- Action如何去使用session request ,application
- sleep和wait
- Java语言的优点
- [PAT] 1001A+B Format (20)
- 自考总结
- 编程作业50页3题 分别使用 do-while和 for 循环计算1+1/2!+1/3!+1/4!...+1/20!
- ALL Code of color snesor with arduino
- 修改svn的注释
- MyEclipse 自动补全返回值对象
- 10.22_数论总结
- windows上编译zlib-1.2.8
- 查看ELF 文件版本信息