1001. A+B Format (20)
来源:互联网 发布:evasi0n7 1.0.0 mac 编辑:程序博客网 时间:2024/06/03 19:33
#include <iostream>#include <cstdio>#include <cmath>using namespace std;string toString(int num){ if(num == 0) return string("0"); string s; int flag = 0; while(num){ s = char(num % 10 + '0') + s; num /= 10; ++flag; if(flag == 3 && num){ flag = 0; s = "," + s; } } return s;}int main(){int a, b;scanf("%d%d", &a, &b);int sum = a + b;int flag = 0; if(sum < 0) printf("-"); string s = toString(abs(sum)); printf("%s", s.c_str());return 0;}
0 0
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- 1001. A+B Format (20)
- iOS实现build号自增
- android webkit 加载js 出现 Error//webConsole:Uncaught Error:cannot call method ‘setItem’ of null at...
- mysql约束
- 师者的教导
- A light weight mysql GUI tool
- 1001. A+B Format (20)
- 数据结构-链表的基础操作实现
- UWP——HttpClient模拟浏览器的GET、POST请求之Win10 Mobile测试
- 未知原因 tomcat 报错
- Service 与 IntentService
- 1002. A+B for Polynomials (25)
- 记录贴(RadioGroup)
- 代码段、数据段、附加段、堆栈段
- 无名管道性质