roots.cpp

来自「密码算法程序包miracl contains all the source c」· C++ 代码 · 共 34 行

CPP
34
字号
/*
 *   Program to calculate roots
 *
 *   Requires: flash.cpp
 * 
 *   Copyright (c) 1988-2001 Shamus Software Ltd.
 */

#include <iostream>
#include "flash.h"

using namespace std;

Miracl precision=50;

int main()
{ /* Find roots */
    Flash x,y;
    int n;
    miracl *mip=&precision;  
    mip->RPOINT=ON;
    cout << "enter number\n";
    cin >> x;
    cout << "to the power of 1/2\n";
    y=sqrt(x);
    cout << y;
    x=y*y;
    cout << "\nto the power of 2 = \n";
    cout << x;
    if (mip->EXACT) cout << "\nResult is exact!\n";
    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?