Search found 2 matches

by Manu_bk
Thu May 31, 2007 9:50 pm
Forum: Volume 101 (10100-10199)
Topic: 10134 - AutoFish
Replies: 2
Views: 2638

Have WA, need help
Here is my code.
I don't know if not understood very well the problem

#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main() {
string s;
bool prim = true;
int pez =0;
int cebo = 0;
int instr = 0;
int pez_cmp = 0;
getline(cin,s ...
by Manu_bk
Fri May 25, 2007 5:19 pm
Forum: Volume 4 (400-499)
Topic: 474 - Heads / Tails Probability
Replies: 50
Views: 18874

474, Need help WA

#include <iostream>
#include <cmath>
using namespace std;

int main() {
cout.setf(ios::fixed);
cout.precision(3);
long n;
double a,tmp;
long b;
while(cin>>n) {
n=-n;
cout<<"2^"<<n<<" = ";
tmp=log10((double)2)*(n);
b=long(floor(tmp));
a=pow((double)10,tmp-b);
cout<<a<<'e'<<b<<endl;
}
}

Go to advanced search