Nasty Hacks

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 2299    Accepted Submission(s): 1816

Problem Description
You are the CEO of Nasty Hacks Inc., a company that creates small pieces of malicious software which teenagers may use

to fool their friends. The company has just finished their first product and it is time to sell it. You want to make as much money as possible and consider advertising in order to increase sales. You get an analyst to predict the expected revenue, both with
and without advertising. You now want to make a decision as to whether you should advertise or not, given the expected revenues.


 
Input
The input consists of n cases, and the first line consists of one positive integer giving n. The next n lines each contain 3 integers, r, e and c. The first, r, is the expected revenue if you do not advertise, the second, e, is the expected revenue if you do
advertise, and the third, c, is the cost of advertising. You can assume that the input will follow these restrictions: -106 ≤ r, e ≤ 106 and 0 ≤ c ≤ 106.
 
Output
Output one line for each test case: “advertise”, “do not advertise” or “does not matter”, presenting whether it is most profitable to advertise or not, or whether it does not make any difference.
 
Sample Input
3
0 100 70
100 130 30
-100 -70 40
 
Sample Output
advertise
does not matter
do not advertise
 
Source

解题思路:继续水题。直接比較每行的三个数。假设第一个数大于第二个数减去第三个数,则须要做广告。若等于。就无所谓。否则。不做广告。

AC代码:

#include <iostream>
#include <cstdio>
using namespace std; int main(){
// freopen("in.txt", "r", stdin);
int n, a, b, c;
while(scanf("%d", &n)==1){
for(int i=0; i<n; i++){
scanf("%d%d%d", &a, &b, &c);
if(a < b - c) printf("advertise\n");
else if(a == b - c) printf("does not matter\n");
else printf("do not advertise\n");
}
}
return 0;
}

最新文章

  1. linux中find批量删除空文件夹
  2. 模拟搭建Web项目的真实运行环境(三)
  3. C语言PIC16 serial bootloader和C#语言bootloader PC端串口通信程序
  4. Collection中Set集合在应用中常见的方法和注意点
  5. WPF_View中控件使用单例ViewModel
  6. Android Design Support Library——Snackbar
  7. getting started with Baxter Research Robot
  8. extjs中grid对于其中表单的表头的读取以及是否隐藏的判断
  9. 在ubuntu下安装chrome
  10. C#“简单加密文本器”的实现
  11. 已经包含了#include &lt;atlcom.h&gt; #include &lt;comutil.h&gt;还是报错
  12. android ScrollView嵌套EditText
  13. 手机自动化测试:appium源码分析之bootstrap十五
  14. Autofac 依赖注入框架 使用
  15. Linux 查看系统版本和内核
  16. 2018.4.24 flask_mail使用
  17. day21 正则表达式
  18. hdparm命令(转)
  19. Application failed to start because it could not find or load the QT platform plugin “windows”
  20. 编程中的幂等性 — HTTP幂等性

热门文章

  1. shell-code-3-echo用法&amp;printf用法
  2. (转)iOS 属性字符串
  3. django的rest framework框架——分页、视图、路由、渲染器
  4. luogu2050 [NOI2012]美食节
  5. xtu数据结构 B. Get Many Persimmon Trees
  6. pytorch中torch.unsqueeze()函数与np.expand_dims()
  7. Django深入----django.db.transaction
  8. dp的两个不错的题
  9. Codeforces Round #305 (Div. 2) D. Mike and Feet
  10. hdu 1536 sg (dfs实现)