Advertisement
jesmori

pierwiastki, funkcje

Jan 26th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int pierw(int q){
  6.     int y;
  7.     y = q*q;
  8.     cout << "Kwadrat liczyby "<< q << " wynosi " << y << endl;
  9. };
  10.  
  11. int pierw(int t, int m){
  12.     int z = 1;
  13.     for (int i=1; i<=m; i++){
  14.         z=z*t;
  15.     }
  16.     cout << "Liczba " << t << " podniesiona do " << m << " potegi wynosi " << z << endl << endl;
  17. }
  18.  
  19. int main()
  20. {
  21.     int x = 1;
  22.     int n = 3;
  23.  
  24.     while (x<=5){
  25.         pierw (x);
  26.         pierw (x, n);
  27.         x++;
  28.     }
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement