2022: icebound的账单

描述
题目描述:
icebound从小就有记账的习惯。又到了月末icebound统计资金状况的时候。icebound每个月除了不停的挥霍以外,有时他会良心发现,勤工俭学,因此会有一些微薄的收入。然而icebound数学不好,需要你来帮助他统计他本月的资金状况。

你将会得到一份icebound的账单,一共有 n​ 行整数,其中正数表示icebound打工挣来的收入,负数表示icebound消费的支出。数据保证不会出现 0​ 。

如果icebound本月总收入大于总支出,请你输出“icebound is happy.”;如果本月总收入等于总支出,请你输出“icebound is ok.";如果总收入小于总支出,请你输出"icebound is sad."。

输入:
第一行,有一个正整数nn,代表账单有nn行。

接下来有nn行,每行一个整数,第i+1i+1行整数a_ia
i
​ 。

1 \leq n \leq 10001≤n≤1000,\left| a_i \right|\leq 1000∣a
i
​ ∣≤1000, a_i \neq 0a
i
​ ≠0

输出:
输出一行。如果icebound本月总收入大于总支出,请你输出“icebound is happy.”;如果本月总收入等于总支出,请你输出“icebound is ok.";如果总收入小于总支出,请你输出"icebound is sad."。

样例输入
2
100
-100
样例输出
icebound is ok.

//						佛祖保佑代码无bug
//
//                            _ooOoo_
//                           o8888888o
//                           88" . "88
//                           (| -_- |)
//                           O\  =  /O
//                        ____/`---'\____
//                      .'  \\|     |//  `.
//                     /  \\|||  :  |||//  \
//                    /  _||||| -:- |||||-  \
//                    |   | \\\  -  /// |   |
//                    | \_|  ''\---/''  |   |
//                    \  .-\__  `-`  ___/-. /
//                  ___`. .'  /--.--\  `. . __
//               ."" '<  `.___\_<|>_/___.'  >'"".
//              | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//              \  \ `-.   \_ __\ /__ _/   .-` /  /
//         ======`-.____`-.___\_____/___.-`____.-'======
//                            `=---='
//        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//					美女保佑代码无BUG
//                       .::::.
//                     .::::::::.
//                    :::::::::::
//                 ..:::::::::::'
//              '::::::::::::'
//                .::::::::::
//           '::::::::::::::..
//                ..::::::::::::.
//              ``::::::::::::::::
//               ::::``:::::::::'        .:::.
//              ::::'   ':::::'       .::::::::.
//            .::::'      ::::     .:::::::'::::.
//           .:::'       :::::  .:::::::::' ':::::.
//          .::'        :::::.:::::::::'      ':::::.
//         .::'         ::::::::::::::'         ``::::.
//     ...:::           ::::::::::::'              ``::.
//    ````':.          ':::::::::'                  ::::..
//                       '.:::::'                    ':'````..
//
//
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<ctime>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<vector>
#define ll long long
#define dd double
using namespace std;

int main() {
	ll n;
	ll a[1005];
	cin >> n;
	ll sum = 0;
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	if (sum > 0) {
		cout << "icebound is happy." << endl;
	}
	else if (sum == 0) {
		cout << "icebound is ok." << endl;
	}
	else {
		cout << "icebound is sad." << endl;
	}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值