Регистрация
27 Авг 2013
Сообщения
78
Репутация
0
Спасибо
0
Монет
0
#include <conio.h>

#include <math.h>

#include <iostream>

using namespace std;

int main()

{

setlocale(LC_ALL, "Russian");

double x, y, s;

cout << "Введите x:";

cin >> x;



if (x > 2, 5) { y = 1 + x;



cout << "1-я ветвь. Результат y=" << y << endl;

}

else if (0 <= x <= 2) (true) {

(y = 1 - x * x * x * x * x);

cout << "2-я ветвь. Результат y= " << y << endl;

}



system("pause"); return 0;

ELSE IF код не видит и всегда выходит на переменную где первая ветвь
 
Тут весь код как будто дцп писал
 
#include
#include
#include
using namespace std;

int main()
{
setlocale(LC_ALL, "Russian");
double x, y, s;
cout > x;

if (x > 2.5) {
y = 1 + x;
cout
 
#include
#include
using namespace std;
int main() {
double x;
cout > x;
cout
 
else if (0 <= x <= 2) (true) - а зачем тебе (true) ? В С++ достаточно условия

(y = 1 - x * x * x * x * x); - да и скобки тут не обязательны
 
Назад
Сверху