![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
四则运算
SJCHEN1221
这个作者很懒,什么都没留下…
展开
-
c语言实现四则远算
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int a,b; char op; scanf("%d%c%d",&a,&op,&b); switch(op) { case '-':printf("%d\n",a-b);bre原创 2018-10-13 11:02:20 · 513 阅读 · 0 评论 -
大数加法
对于一些比long int还大的数,我们应该如何计算加法呢? 可以想到的是可以转换为字符串去计算。 思路: 1,逆序输入 2,加法 1)主要就是考虑进位。 比如我们计算987654321 + 5678 对于高位不足的我们补0 最后结果在逆序输出就行了 1 2 3 4 5 6 7 8 9 8 7 6 5 0...原创 2018-12-24 13:08:26 · 177 阅读 · 0 评论