Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include <stdlib.h>
- using namespace std;
- double wyrazenie1(double liczba1, double liczba2){
- return sqrt(liczba1) + liczba2;
- }
- double wyrazenie2(double liczba1, double liczba2){
- if(liczba2!=0){
- return liczba1/liczba2;
- }else {
- return 0;
- }
- }
- double wyrazenie3(double liczba1, double liczba2){
- return pow(liczba1, liczba2);
- }
- double wyrazenie4(double liczba1, double liczba2){
- if(liczba1>0){
- return (liczba1+liczba2)/sqrt(liczba1);
- }else {
- return 0;
- }
- }
- double wyrazenie5(double liczba1, double liczba2){
- if(liczba2>0){
- return pow(liczba1,sqrt(liczba2) )/liczba2;
- }else{
- return 0;
- }
- }
- int main()
- {
- double liczba1, liczba2;
- cout << "Kalkulator powtorzenie" << endl;
- cout << "-------------------------" << endl;
- cout << "Podaj liczbe1="; cin >> liczba1;
- cout << "Podaj liczbe2="; cin >> liczba2;
- cout << "-------------------------" << endl;
- cout << "Wynik WYRAZENIE1=" << wyrazenie1(liczba1, liczba2) << endl;
- cout << "-------------------------" << endl;
- cout << "Wynik WYRAZENIE2=" << wyrazenie2(liczba1, liczba2) << endl;
- cout << "-------------------------" << endl;
- cout << "Wynik WYRAZENIE3=" << wyrazenie3(liczba1, liczba2) << endl;
- cout << "-------------------------" << endl;
- cout << "Wynik WYRAZENIE4=" << wyrazenie4(liczba1, liczba2) << endl;
- cout << "-------------------------" << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement