摘要:
本来想到二分查找,后来发现直接使用pow,floor和ceil就可以。这些函数在cmath中。View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <cmath>using namespace std;int main(){ freopen("D:\\t.txt", "r", stdin); int b, n; while (scanf("%d%d" 阅读全文
posted @ 2011-02-28 12:28
undefined2024
阅读(235)
评论(0)
推荐(0)
摘要:
这一题学会了两个东西:1.cmath中的exp(x)函数是用来求e的x次幂。2.对于double类型scanf时要用%lf,printf时要用%f。这个题就是个套公式的简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <cmath>using namespace std;int getid(char *st){ if (strcmp(st, "T") == 0) return 0 阅读全文
posted @ 2011-02-28 11:15
undefined2024
阅读(669)
评论(0)
推荐(0)