Computer Programming Contest Preparation

ToolBox - Source for: 101/10113/judged.cpp



/home/toolbox/public_html/solutions/101/10113/judged.cpp
    1 #include <iostream>          //  Accepted
    2 #include <cstdlib>
    3 #include <math.h>
    4 #include <iomanip>
    5 
    6 using namespace std;
    7 
    8 int main()
    9 {
   10     long double n, p;
   11     while(cin >> n >> p)
   12         {
   13             std::cout << "n = " << n << std::endl;
   14             std::cout << "p = " << p << std::endl;
   15             std::cout << "sizeof(long double) = " << sizeof(long double) << std::endl;
   16             cout << setprecision(0) << setiosflags(ios::fixed) << (long double)pow(10.0, ((long double)log10(p) / n)) << endl;
   17         }
   18     return 0;
   19 }
   20