Having used cin/cout streams all the time, I decided to learn scanf. Now I have some problems with reading long double. I use Dev-cpp.
There is a part of my program:
...
typedef long double ld;
...
pair <ld, ld> c[Maxn];
...
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%Lf %Lf", &c[i].first, &c[i].second);
cout << c[0].first << " " << c[0].second << endl;
...
My input:
3
-5 9
0 1
5 -1
Output:
0 0
So no long doubles are read. I tried to replace "Lf" with "Le", "LE", "Lg", "LG", "e", "E", "f", "g", "G", "le", "lE", "lf", "lg", "lG". None of them seems to be working. Where is the problem?
long double r = 1.234567890123456;
printf("%.10lf", double(r));
There is a same topic: http://codeforces.net/blog/entry/2071
%lf - double
%llf - long double
%llf doesn't work!
Usually it is sufficient to read input as doubles.
The same goes for output.