fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string number = "";
  6. number = (char)53 + number;
  7. number = (char)52 + number;
  8. cout << "Expected : a string equals to 45" << endl;
  9. cout << number << endl;
  10.  
  11.  
  12. int numberInt = ('4'-48)*10+'5'-48;
  13. cout << "Expected : an integer equals to 45" << endl;
  14. cout << numberInt<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Expected : a string equals to 45
45
Expected : an integer equals to 45
45