Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //1. Broevi so edinica 0
- for(int i=100; i<=999; i++)
- {
- if(i%10==0) cout << i << endl;
- }
- //2. X na n
- int x, n, br=1;
- cout << "Vnesi broj: ";
- cin >> x;
- cout << "Vnesi stepen: ";
- cin >> n;
- for(int i=1; i<=n; i++)
- {
- br*=x;
- }
- cout << x << "^" << n << "=" << br;
- //3. Broj na pozitivni/negativni
- int brP=0, brN=0,a;
- for(int i=1; i<=10; i++)
- {
- cin >> a;
- if(a>0) brP++;
- else brN++;
- }
- if(brP>brN) cout << "Vneseni se poveke pozitvni broevi";
- else cout << "Vneseni se poveke negativni broevi";
- //4. Broj na parni vo opseg
- int b, c, parni=0;
- cout << "Vnesi opseg: "
- cin >> b >> c;
- if (c>b)
- {
- int temp=c;
- c=b;
- b=temp;
- }
- for( ;b<=c; b++)
- {
- if(b%2==0) parni++;
- }
- cout << "Vo toj opseg ima " << parni << "broevi"
- //5. Deliteli
- int d;
- cout << "Vnesi broj: ";
- cin >> d;
- cout << "Deliteli na " << d << "se:" << endl;
- for(int i=1; i<=d; i++)
- {
- if(d%i==0) cout << i << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement