poj 3030 Nasty Hacks 题目链接:http://poj.org/problem?id=3030
模拟水
题目大意:输入三个数,分别代表不做广告的效果、做广告的效果、做广告的花销,输出决定。
以下是代码:
#include<iostream>
using namespace std;
int main()
{
int n,a,b,c;
cin>>n;
while(n--)
{
cin>>a>>b>>c;
if(a>b-c)cout<<"do not advertise"<<endl;
else if(a==b-c)cout<<"does not matter"<<endl;
else cout<<"advertise"<<endl;
}
return 0;
}
本题核心算法:比较两数大小。