Facebook
From Małpa Albinos, 5 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 147
  1. #include <iostream>
  2. #include <math.h>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. double zaokraglij(double wartosc){
  8.     return round(wartosc*10000)/10000;
  9. }
  10.  
  11. int main()
  12. {
  13.  
  14.     cout<<"Program sluzy do dzielenia wartosci przypisanych na sztywno."<<endl;
  15.  
  16.     int a = 5;
  17.     int b = 2;
  18.     float c = a/b;
  19.  
  20.     cout<<"Dzielenie dwoch intow: "<<c<<endl; //wynik 2
  21.  
  22.     float d = (float) a/b ;
  23.  
  24.     cout<<"Dzielenie dwoch intow z jawnym rzutowaniem wyniku: "<<d<<endl; //wynik 2.5
  25.  
  26.     system("PAUSE");
  27.     return 0;
  28. }
  29.  
  30.