Anna3O0

Valoarea sumei

Jun 27th, 2019
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int suma;
  6.  
  7. int main()
  8. {
  9. float n;
  10. cin>>n;
  11. for (int i=1; i<=n ; i=i+2)
  12. suma=suma+i;
  13. cout <<suma ;
  14. return 0;
  15. }
RAW Paste Data