题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=6038

因为TopCoder SRM比赛使用的编译器进行了升级,所以进行了一次Test SRM,这次比赛不计rating. 题目是从SRM 200 -400间随机选择的。

这道题目就是解一个二元一次方程。

代码如下:

#include <iostream>

using namespace std;

class TemperatureScales
{
public:
double convert(int f1, int b1, int f2, int b2, int t);
}; double TemperatureScales::convert(int f1, int b1, int f2, int b2, int t)
{
double a, b; a = ( (double)(f2 - b2) ) / (f1 - b1);
b = ( (double)(f1*b2 - f2*b1) ) / (f1 - b1);
return (double)(a * t + b);
}

Test SRM Level One: TemperatureScales的更多相关文章

  1. Test SRM Level Two: CountExpressions, Brute Force

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=8157 这道题目跟扑克牌算24的题目比较像,但要简单一些.点击查 ...

  2. Test SRM Level Three: LargestCircle, Brute Force

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3005&rd=5858 思路: 如果直接用Brute F ...

  3. SRM 223 Div II Level Two: BlackAndRed,O(N)复杂度

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3457&rd=5869 解答分析:http://comm ...

  4. SRM 207 Div II Level Two: RegularSeason,字符串操作(sstream),多关键字排序(操作符重载)

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=2866&rd=5853 主要是要对字符串的操作要熟悉,熟 ...

  5. SRM 577 Div II Level Two: EllysRoomAssignmentsDiv2

    题目来源: http://community.topcoder.com/tc?module=ProblemDetail&rd=15497&pm=12521 这个问题要注意的就是只需要直 ...

  6. SRM 582 Div II Level One: SemiPerfectSquare

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12580 比较简单,代码如下: #include <ios ...

  7. SRM 582 Div II Level Two SpaceWarDiv2

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12556 #include <iostream> # ...

  8. SRM 582 Div II Level Three: ColorTheCells, Brute Force 算法

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12581 Burte Force 算法,求解了所有了情况,注意  ...

  9. SRM 583 Div II Level One:SwappingDigits

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609 #include <iostream> # ...

随机推荐

  1. 14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发

    14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发 InnoDB 使用操作系统threads 来处理用户的事务请求.(事务可以执行 ...

  2. gcc -D 传值给代码,默认值为1

    gcc -D 传值给代码,默认值为1 -D 参数可以给代码中的宏打开一扇门.简单的代码#include <stdio.h> #ifdef WHO #define NAME "jo ...

  3. Linux 双网卡绑定技术

    bond技术是在linux2.4以后加入内核. 一般步骤是1.把bonding模块加入内核, 2 编辑要绑定的网卡设置,去除地址设定 3 添加bond设备,设置地址等配置 4  重启网络 5 在交换机 ...

  4. [面经] 南京SAP面试(上)

    背景 博主乃985弱校的小硕一枚,在南京某外企工作了两年,如今的公司还不错,待遇还行,做的东西也比較有意思.在南京这个地方,给力的公司不太多,仅仅要是跟亲戚朋友聊到我在南京做IT,无一例外都会问&qu ...

  5. ACM-最小生成树之畅通project——hdu1863

    ***************************************转载请注明出处:http://blog.csdn.net/lttree************************** ...

  6. JAVA泛型之<? extends T>:(通配符上限)和<? super T>(通配符下限)

    一.通配符上限和通配符下限接受的类型 通配符上限:<? extends T> 通配符下限:<? super T> 以下代码是测试结果,注释为解释说明 package xayd. ...

  7. 积累的VC编程小技巧之组合框

    1.如何正确的得到ComBox的指针 CComboBox *mComb = (CComboBox*)GetDlgItem(IDC_DuanCB); CComboBox *mComb = (CCombo ...

  8. Vim -&gt; 边确认边查找替换

    进行简单的全局查找替换的时候,能够使用ex的例如以下命令 :%s/which/what/g 它的使用方法比較简单 % 表示每一行(everyline) s 替换(substitue) which 查找 ...

  9. 利用Node.js实现模拟Session验证的登陆

    1.身份验证和用户登陆 在一般的Web应用上,假设要实现用户登陆,最经常使用,也是最简单的方法就是使用Session,主要的思路是在Session中保留一些用户身份信息,然后每次在Session中取, ...

  10. Visual Studio 2008中FormatX源代码格式化插件

    原地址:http://www.cr173.com/html/15492_1.html 我总是对组里的兄弟代码规范性近乎完美的要求,举个简单的例子: 1.  每个方法必须有注释,方法参数详细说明 2.  ...