Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double a=0, b=0, c=0;
- while ((a<=0) || (a-int(a)!=0)) {
- cout<<"podaj czynnik"<<endl;
- cin>>a;
- if((a>=0) & (a-int(a)==0))
- c++;
- if(a==0)
- goto alternatywa;
- }
- while (a<10000){
- cout<<"podaj czynnik"<<endl;
- cin>>b;
- if(b==0){
- c++;
- goto alternatywa;
- }
- if( (b>=0) & (b-int(b)==0) & (a>=0) & (a-int(a)==0)){
- a=a*b;
- c++;
- }
- }
- cout<<"twoj wynik wynosi "<<a<<endl;
- cout<<"liczba niezignorowwnych liczb "<<c;
- alternatywa:
- if((a==0) or (b==0)){
- cout<<"jesli jakimkolwiek czynnikiem mnozenia bedzie 0, wynik rowniez zawsze wyniesie 0!"<<endl;
- cout<<"liczba dotychczas niezignorowanych liczb "<<c;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement