Advertisement
Dani_info

suma maxima a4 nr reale

Oct 17th, 2017
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. float a, b, c,d, s=0;
  8. cout<<"a=";cin>>a;
  9. cout<<"b=";cin>>b;
  10. cout<<"c=";cin>>c;
  11. cout<<"d=";cin>>d;
  12. if(a>0)
  13. s=s+a;
  14. else
  15. s=s;
  16. if(b>0)
  17. s=s+b;
  18. else
  19. s=s;
  20. if(c>0)
  21. s=s+c;
  22. else
  23. s=s;
  24. if(d>0)
  25. s=s+d;
  26. else
  27. s=s;
  28. cout<<"s="<<s;
  29.  
  30.  
  31. return 0;
Advertisement
RAW Paste Data Copied
Advertisement