Advertisement
Jambix64

ConvertendoInteiroParaDouble_static_cast

Jul 14th, 2016
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1.  #include <iostream>
  2.  #include <stdlib.h>
  3.  #include <stdio.h>
  4.  #include  <windows.h>
  5.  using namespace std;
  6.   int account(){
  7.     int i;
  8.       for ( i = 0;i<500;)
  9.           i++;
  10.           return i++;
  11.   }
  12. int main()
  13.  {   // Parece que covertir um x inteiro para double;
  14.       char r;
  15.       int x;
  16.       int y = 10;
  17.       double cast;
  18.       const     char n [4] = {'S','s','N','n'};
  19.       cout<<"Digite o valor do seu dinheiro"<<endl;
  20.       cin>>x;
  21.       cout<<"Voce recebeu +10? S/N"<<endl;
  22.       cin>>r;
  23.       if( r == n[1] || r == n[2]){
  24.        
  25.       //cast = static_cast <double>(x) + y + account() + system("color 2"); Existe essa maneira de  calcular;
  26.       cast = static_cast <double>(x);
  27.       cout<<cast<<endl;
  28.        
  29.       }
  30.        
  31.      return false;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement