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