国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

1001. A+B Format (20)

2019-11-08 02:59:11
字體:
來源:轉載
供稿:網友

https://www.patest.cn/contests/pat-a-PRactise/1001

#include <cstdio>#include <iostream>#include <cmath>using namespace std;int main(){ int a, b,str[100],k = 0; cin >> a >> b; int sum = a + b; if (sum == 0){ cout << 0 << endl; return 0; } if (sum < 0) { sum = -sum; cout << "-"; } if (sum == 0){ cout << 0 << endl; } else { while (sum) { int s1 = sum % 10; sum = sum / 10; str[k++] = s1; } for (int i = k-1; i >= 0; i--) { cout << str[i]; if ((i) % 3 == 0 && i != 0) cout << ","; } cout << endl; } return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 连江县| 巴马| 通江县| 宝丰县| 大厂| 舞钢市| 沭阳县| 浙江省| 洮南市| 南宫市| 甘南县| 正镶白旗| 天津市| 措勤县| 新安县| 高唐县| 集贤县| 安徽省| 保亭| 库车县| 资兴市| 秦安县| 沙田区| 天气| 保定市| 梁河县| 南雄市| 青阳县| 康保县| 林州市| 丰原市| 三穗县| 明水县| 修文县| 诏安县| 淅川县| 如皋市| 江口县| 乌海市| 桐梓县| 阿克|