随笔2 PAT1001.A+B Format (20)】的更多相关文章

1001.A+B Format(20) 题目链接 1001.A+B Format (20) C++ 代码 第一次使用markdown,还不是很习惯,现在努力的在适应它 首先这道题我们很容易就可以读懂题意,就是简单的a+b,只不过要求我们在输出sum的时候处理一下数字的格式.那么我的做法是这样的: 在读入两个数字之后,求出sum,同时,判断sum符号,如果小于零可以立刻输出一个负号,且执行 sum=abs(sum); ,如果sum的绝对值小于1000,那么我们就直接输出sum,结束程序.否则将su…
1001. A+B Format (20) github链接 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B Calculate a + b and output the sum in standard format -- that is,the digits must be separated into groups of three by commas(unless there are less than four digits). Input Each i…
Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Specification: Each input file contains one test case. Each case contains a pa…
#include<stdio.h> int main(){ //定义要读入的两个整数 int a,b; //定义好放拆项用的数组 ]; //读入两个整数 scanf("%d%d",&a,&b); //求和 int ans=a+b; //如果和是一个负数 ,输出负号,把和变为正数 ){ printf("-"); ans=-ans; } //如果和小于1000 ,直接输出 ){ printf("%d\n",ans); }e…
Someting about 1001.A+B Format (20) 问题描述及我所写的代码:click here → My Task 看到这个题目的时候,我的想法很简单,直接判断直接输出,因为给定的a,b的范围都是在-1,000,000到1,000,000之间,因此a与b的和sum的位数最多只能为7,所以分成需要输出0个(0<= |sum| <= 999).1个(1000 <= |sum| <= 999999).2个逗号(1000000 <= |sum| <=200…
1001.A+B Format (20)代码自查(补足版) 谢谢畅畅酱的提醒,发现了代码中的不足,把变量名更改成更合理的名字,并且把注释也换成英文啦! 栋哥提供的代码自查的方式也帮助了我发现很多代码中的不足,一些边界问题上的处理,自己也补足了很多.重新更新了一下git,也发现提交时需要注意的问题.这里是我的 git 打算更新版本时,无法commit的一个问题Another git process seems to be running in this repository, e.g. an ed…
1001 A+B Format (20)(20 分) Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Each input file contains one test case. Each case…
1001 A+B Format (20)(20 分) Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Each input file contains one test case. Each case…
1001. A+B Format (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four d…
1001.A+B Format(20) 首先要感谢一下指导我github上传问题的小伙伴们,捣腾了一整天我终于摸到了一点门路,真的谢谢你们. 小豪的github 问题描述: Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digi…