I wanna know if it is possible to use the scientific notation with variables?
For example:
int n;
cin >> n;
int x = 1en;
instead of
int x = 1e8
Is it possible? If yes, how?
I wanna know if it is possible to use the scientific notation with variables?
For example:
int n;
cin >> n;
int x = 1en;
instead of
int x = 1e8
Is it possible? If yes, how?
The closest you can do is define a macro in the following way:
You cannot avoid using pow since n is evaluated at run time. This just like C works.
#define e(n) *pow(10,n)
And you use it:
int n; cin >> n; int x = 1 e(n);