Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <cstdlib>
- using namespace std;
- main()
- {
- int i=1, n,a ;
- double liczba, x, suma=0;
- cout << "podaj liczbe wyrazow ";
- cin >> n;
- while(i<=n)
- {
- cout << "liczba " << i << " to ";
- cin >> x;
- i++;
- if(fmod(x,2)!=0)
- {
- suma+=x;
- }
- }
- cout << "Suma: " << suma << "\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement