Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <iomanip>
- #include <cstdlib>
- using namespace std;
- void sortuj1 (double &x, double &y)
- {
- if (x<y)
- {
- double z=y;
- y=x;
- x=z;
- }
- }
- void sortuj (int *tab,int N)
- {
- int x=0;
- for(int i=0; i<N; i++)
- {
- for (int j=0; j<N; j++)
- {
- if (tab[i]<tab[j])
- {
- x=tab[i];
- tab[i]=tab[j];
- tab[j]=x;
- }
- }
- }
- }
- void wypisz (int tab[], int N)
- {
- for (int i=0; i<N; i++)
- {
- cout << "Tab [ " << i+1 <<" ] : " << tab[i] << endl;
- }
- }
- int main()
- {
- /*
- int x=0;
- cout << "Podaj dlugosc kreski do wciongniecia hehe: " << endl;
- cin >> x;
- for (int i=0; i<x ; i++)
- {
- cout << "|\n";
- }
- */
- /*
- double A=0, B=0, C=0;
- double suma=0, iloczyn=0, srednia=0, potega=0;
- cout << "Podaj 3 liczby: " << endl;
- cout << "A: ";
- cin >> A;
- cout << "B: ";
- cin >> B;
- cout << "C: ";
- cin >> C;
- suma=A+B+C;
- iloczyn=A*B*C;
- srednia=(A+B+C)/3;
- potega=pow(A,B);
- cout << "Suma: : " << suma << endl;
- cout << "Srednia : " << srednia << endl;
- cout << "Potega : " << potega << endl;
- */
- /*
- double a=0;
- double b=0;
- cout << "Podaj 2 liczby: " << endl;
- cout << "a = ";
- cin >> a;
- cout << "b = ";
- cin >> b;
- sortuj1 (a,b);
- cout << "a i b posortowane od najwiekszej do najmniejszej to : " << a << " " << b;
- */
- /*
- int x=0;
- cin >> x;
- for (int i=0; i<x; i++)
- {
- cout << setw(i+1);
- for (int j=0; j<(2*(x-i)-1) ; j++)
- {
- cout << "*";
- }
- cout << endl;
- */
- /*
- int x=0;
- cin >> x;
- for (int i=0; i<x; i++)
- {
- cout << setw(x-i);
- for (int j=0; j<(2*i+1) ; j++)
- {
- cout << "*";
- }
- cout << endl;
- }
- */
- /*
- int N=0;
- int *tab;
- cout << "Ile liczb wprowadzic do tablicy? " << endl;
- cin >> N;
- tab= new int [N];
- for (int i=0; i<N; i++)
- {
- cout << "Tab [ " << i+1 << " ] :";
- cin >> tab [i] ;
- }
- sortuj (tab, N);
- wypisz (tab, N);
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement