Home > Back-end >  Problem solving is code: blocks of or what, can't give type double assignment; Hope to be able
Problem solving is code: blocks of or what, can't give type double assignment; Hope to be able

Time:09-24




Not solve, % lf; But to float n; Can assignment that is eight,
 
#include
#include

using namespace std;

Int main ()
{double n;
The scanf (" % f ", & amp; n);
Printf (" % f ", n);

return 0;
}

CodePudding user response:

Lf the scanf (" % ", & amp; n); Lf not line? Long float

CodePudding user response:

Lf the scanf (" % ", & amp; n); Should ok,

CodePudding user response:

I can't, the scanf (" % lf ", & amp; n); I tried just cannot copy; I create the CPP file

CodePudding user response:

Unable to assignment

CodePudding user response:

Try the le or lg,

CodePudding user response:

Using the scanf (" % lg ", & amp; n); Or use the scanf (" % le ", & amp; n); Can be assigned;
But the output of the printf must use % f
Why???????
It is ok. C document! So why not CPP?

CodePudding user response:

Verified, the scanf (" % lf ", & amp; n); Yes, vc + + (2010 and 2013), BCC, 6.70 GCC 4.7.0 can,

CodePudding user response:

Your codeblock use is what the compiler, that version?
  • Related