当前位置:网站首页>用C语言解决A+B问题,A-B问题,A*B问题
用C语言解决A+B问题,A-B问题,A*B问题
2022-08-03 11:36:00 【ceshyong】
题目链接
A+B问题:A+B问题
A-B问题:没找到
A*B问题:A*B问题
题目描述 略。
题目思路
这些题目都十分简单(都是水题),直接定义一个变量,输出A+B,A-B,A*B就行了。
但是光这样写是拿不了全分的。我们还需要把那个变量改成long long。
然后就输入A,B,输出那个变量,就行了。
注意printf不用带&号。(C++也可以这样写)
AC代码
A+B问题:
#include<stdio.h>
int main()
{
int a,b;
scanf("%d",&a,&b);
long long c=a+b;
printf("%lld",c);
}
A-B问题:
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
long long c=a-b;
printf("%lld",c);
}
A*B问题:
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
long long c=a*b;
printf("%lld",c);
}
边栏推荐
猜你喜欢
【MySQL功法】第4话 · 和kiko一起探索MySQL中的运算符
【MySQL功法】第2话 · 数据库与数据表的基本操作
MySQL之json数据操作
用于发票处理的 DocuWare,摆脱纸张和数据输入的束缚,自动处理所有收到的发票
Redis发布订阅和数据类型
「全球数字经济大会」登陆 N 世界,融云提供通信云服务支持
Classical Architecture and Memory Classification of Embedded Software Components
For invoice processing DocuWare, cast off the yoke of the paper and data input, automatic processing all the invoice received
缓存--伪共享问题
Skills required to be a good architect: How to draw a system architecture that everyone will love?What's the secret?Come and open this article to see it!...
随机推荐
Machines need tokens more than people
LP流动性挖矿DAPP系统开发丨流动性挖矿功能原理及说明
LeetCode-142. 环形链表 II
LeetCode——1161. 最大层内元素和
【一起学Rust】Rust的Hello Rust详细解析
Android 技术面试准备(含面试题及答案)
Dva.js 新手入门指南
LeetCode 899 有序队列[字典序] HERODING的LeetCode之路
智能合约是什么?
[LeetCode—Question 2 Sum of Two Numbers Detailed Code Explanation ] The source code is attached, which can be copied directly
卷起来!阿里高工携18位高级架构师耗时57天整合的1658页面试总结
缓存--伪共享问题
实现2d人物在跳跃的同时左右移动
CDH6.3.2开启kerberos认证
浅谈SVN备份
For invoice processing DocuWare, cast off the yoke of the paper and data input, automatic processing all the invoice received
LyScript 实现对内存堆栈扫描
Machine Learning (Chapter 1) - Feature Engineering
后台图库上传功能
MySQL之json数据操作