Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ვარიანტი 1
- 2)
- #include <iostream>
- using namespace std;
- int main() {
- double x;
- cin >> x;
- if (x >= 1) {
- cout << x;
- } else if (x >= -1 && x < 1) {
- cout << -x;
- } else if (x < -1){
- cout << (2*x -1);
- }
- return 0;
- }
- 3)
- #include <iostream>
- using namespace std;
- double max(int a, int b) {
- if (a > b) {
- return a;
- }
- return b;
- }
- int main() {
- double a, b, c;
- cin >> a >> b >> c;
- double m = max(a, b);
- m = max(m, c);
- cout << m;
- return 0;
- }
- 4)
- #include <iostream>
- using namespace std;
- int main() {
- double x;
- cin >> x;
- double y = 5 * x * x + 4 * x - 7;
- cout << y;
- return 0;
- }
- 5)
- #include <iostream>
- using namespace std;
- int main() {
- double a, b;
- cin >> a >> b;
- double area = a * b;
- cout << area;
- return 0;
- }
- ვარიანტი 2
- 2)
- #include <iostream>
- using namespace std;
- int main() {
- double x;
- cin >> x;
- if (x >= 0) {
- cout << x;
- } else if (x == 0) {
- cout << 0;
- } else if (x < 0){
- cout << -x;
- }
- return 0;
- }
- 5)
- #include <iostream>
- using namespace std;
- int main() {
- double x;
- cin >> x;
- double y = 7 * x * x + 2 * x - 5;
- cout << y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement