Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Zad 3
- #include <iostream>
- using namespace std;
- int main() {
- int i,b;
- int a=1;
- cout<<"Wpisz liczbe"<<endl;
- cin>>b;
- if(b<0)
- {
- cout<<"Wprowadzono bledna liczbe"<< endl;
- }
- else if (b==0)
- {
- cout<<"silna 0=1"<< endl;
- }
- else
- {
- for (i=1; i<=b; i++)
- {
- a=i*a;
- }
- cout<<a<<endl;
- }
- return 0
- }
- zad 7
- #include <iostream>
- using namespace std;
- int main() {
- int a;
- float p, ob;
- do
- {
- cout<<"Wpisz dlugosc promienia"<<endl;
- cin>>a;
- }
- while (a<=0);
- p=3.14*a*a;
- ob=2*3.14*a;
- cout<<"Pole="<<p<<endl;
- cout<<"Obwod="<<ob<<endl;
- }
- zad 8
- #include <iostream>
- using namespace std;
- int main()
- {
- int i;
- int a;
- int minimal;
- int maksymal;
- cout << "Wpisz liczbe:" << endl;
- cin >> a;
- minimal = a;
- maksymal = a;
- while (a != 0)
- {
- if (minimal > a)
- minimal = a;
- if (maksymal < a)
- maksymal = a;
- cin >> a;
- }
- cout << "Wartosc maksymalna wsrod podanych liczb jest rowna: "<< maksymal << endl;
- cout << "Wartosc minimalna wsrod podanych liczb jest rowna: "<< minimal << endl;
- }
- Zad 10
- #include <iostream>
- using namespace std;
- int main(int argc, char *argv[])
- {
- int wysokosc,szerokosc;
- cout << "szerokosc="<<endl;
- cin >> szerokosc;
- cout << "wysokosc="<<endl;
- cin >> wysokosc;
- cout << endl;
- for(int i=1; i <= wysokosc; i++)
- {
- for (int k=1; k <= szerokosc; k++)
- cout << "*";
- cout << endl;
- }
- cout << endl;
- system("PAUSE");
- return 0;
- }
- Zad 11
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- cout << "Wpisz dlugosc boku: "<<endl;
- cin>>a;
- for(int i=a;i>0; i--)
- {
- for(int j=0;j<i;j++)
- cout<<"*";
- cout<<endl;
- }
- return 0;
- }
- Zad 12
- #include <iostream>
- using namespace std;
- int main()
- {
- int a = 0;
- while (a < 50)
- {
- int b = 0;
- cin>>b;
- a += b;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment