Facebook
From Scorching Capybara, 6 Years ago, written in C++.
This paste is a reply to Re: Re: Re: Re: Re: Untitled from Social Treeshrew - view diff
Embed
Download Paste or View Raw
Hits: 413
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int cyfra, suma, nieparzyste=0;
  5. int main()
  6. {
  7.     while(true){
  8.         cout << "Podaj cyfre ";
  9.         cin>>cyfra;
  10.         if(cyfra%2==0){
  11.             suma=suma+cyfra;
  12.         }
  13.         else {
  14.             nieparzyste++;
  15.         }
  16.         if(cyfra==0){
  17.             cout<<"Suma parzystych " << suma<<endl;
  18.             cout<<"Ilosc nieparzystych "<<nieparzyste<<endl;
  19.         }
  20.     }
  21.         return 0;
  22.  
  23. }
  24.