摘要: cout.precisionHintIn C++ language, cout.precision is used to set the effective numbers of output.You may use it in the program. E.g. cout.precision(15). In C language, format "%.2lf" may be used在JOJ 1001的hint中看到的,这样就可以提高cout的精度 阅读全文
posted @ 2012-11-13 21:47 MFT 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 我只知道cout.setf()是用来设志位的,cout.precision()是用来设置精度的,但它们的作用是表现在哪些方面呢? 如下程序: …… int main() { cout.precision(2);//难道是设置精度为2? cout.setf(ios::fixed, ios:: floatfield); //这个不明白是什么意思? int i = 10,j = 20; cout << "i, j = " << ", " << j << ".\n"; Swap (i, j); 阅读全文
posted @ 2012-11-13 21:45 MFT 阅读(2615) 评论(0) 推荐(0) 编辑