fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double a = 5.123 * pow(10, -1);
  7. double b = 4.987 * pow(10, 2);
  8.  
  9. double iloczyn = a * b;
  10. double suma = a + b;
  11.  
  12. cout << "a = " << a << endl;
  13. cout << "b = " << b << endl;
  14.  
  15. cout << "Iloczyn: " << iloczyn << endl;
  16. cout << "Suma: " << suma << endl;
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
a = 0.5123
b = 498.7
Iloczyn: 255.484
Suma:    499.212