Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- unsigned int n;
- int s=0, i=1, x=0;
- bool rownosc(int x)
- {
- if (x==2) return true; else return false;
- }
- bool parzysta(unsigned int n)
- {
- if (n%2==0) return true; else return false;
- }
- int main()
- {
- for(;;)
- {
- if (rownosc(x)==false)
- {cout<<"Podaj "<<i<<" liczbe: ";
- cin>>n;
- i++;
- s=s+n;
- if (parzysta(n)==true) x=x+1;
- else x=0;
- }
- else break;
- }
- cout<<"Suma wynosi "<<s<<".";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement