表达式计算2-复杂版
2024-04-23 21:51:27
发布于:江苏
18阅读
0回复
0点赞
在这个代码中只不过用了很多的#define
和一个函数void _Output
#include <bits/stdc++.h>
// #define _INT_MAX 2147483647
// #define _LONG_LONG_MAX 9223372036854775807
// #define _MATH_DEFINES_DEFINED
// #define debug freopen("in.txt","r",stdin), freopen("out.txt","w",stdout);
#define ZERO 0
#define CHARCTER ""
// #define CHARCTER_SPACE " "
#define CHARACTER_LINE_BREAK "\n"
#define FOUR_THOUSAND_THREE_HUNDRED_AND_NINETY_SIX 4396
#define TWO_THOUSAND_TWO_HUNDRED 2200
// #pragma GCC optimize("O2")
using namespace std;
int h = FOUR_THOUSAND_THREE_HUNDRED_AND_NINETY_SIX, g = TWO_THOUSAND_TWO_HUNDRED;
void _Output(int _print, string _plus);
void _Output(int _print, string _plus) {
cout << _print << _plus; }
int main(void) {
ios::sync_with_stdio(false);
cin.tie(ZERO);
cout.tie(ZERO);
cout << "4396+2200=";
_Output(h + g, CHARACTER_LINE_BREAK);
cout << "4396-2200=";
_Output(h - g, CHARACTER_LINE_BREAK);
cout << "4396*2200=";
_Output(h * g, CHARACTER_LINE_BREAK);
cout << "4396/2200=";
_Output(h / g, CHARACTER_LINE_BREAK);
cout << "4396%2200=";
_Output(h % g, CHARACTER_LINE_BREAK);
return ZERO; }
全部评论 1
此帖并非标准题解!具体请看
A730.表达式计算2
2024-04-29 来自 江苏
0
有帮助,赞一个