小编Anm*_*thi的帖子

设定精度不正常

#include <iostream>
using namespace std;

int main()
{
    cout.precision(50);
    cout<<"Anmol's Square Root Calculator!"<<endl;
    cout<<""<<endl;
    cout << "This program will compute the square root\n";
    cout << "of a number using the Babylonian algorithm!\n";
    cout<<""<<endl;
    cout<<"Only positive numbers work with this algorithm!"<<endl;
    cout<<""<<endl;
    cout<<"All cycle #1 approximate square roots are guessed\n"<<"using 1 as the first        approximate."<<endl;
    cout<<""<<endl;
    cout<<""<<endl;
    cout<<""<<endl;



    char playAgain='y';
    while (playAgain !='n') 
    {
        int count(25), cycle(1);
        double guess, sqrt, num; 
        cout << "Please enter the number you would like to …
Run Code Online (Sandbox Code Playgroud)

c++ precision decimal

0
推荐指数
1
解决办法
5233
查看次数

标签 统计

c++ ×1

decimal ×1

precision ×1