Вопрос задан 31.07.2023 в 03:39. Предмет Информатика. Спрашивает Борисова Настя.

Што не так С++ ( #include using namespace std; int main() { double

ab,ad,ax,ay,bx,by,dx,dy,cx,cy,o1,o2,d1,d2,v; if(ax,ay,bx,by,dx,dy,cx,cy < 100); cin>>ax>>" ">>ay; cin>>bx>>" ">>by; cin>>cx>>" ">>cy; cin>>dx>>" ">>dy; ab=bx-ax; ad=ay-dy; v=2*(ab*ab+ad*ad); v=d1+d2; d1=d2-ad; o1=ad; o2=ab; o1,o2,d1,d2;~0,001; cout<
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Паршаков Никита.
Во-первых "что", а не "што"
Во-вторых ЧТО ЭТО ВООБЩЕ ТАКОЕ?!! Это... это просто... I have not any words about it...
#include - подключение какой-либо библиотеки (#include <iostream>)
if(ax,ay,bx,by,dx,dy,cx,cy < 100) - это непонятно даже мне (компу и подавно)
cin>>ax>>" ">>ay;       в cin не пишутся кавычки
~ - вообще непонятно откуда.
Вывод либо автор сего произведения не в себе, либо это какой-то троллинг людей, которые будут читать это


0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

There are several issues with the provided C++ code. I'll list them one by one and explain the problems:

  1. Missing header files: The code lacks the necessary header files for the standard input/output operations and basic mathematical functions. You should include the required headers at the beginning of the code:
cpp
#include <iostream> #include <cmath>
  1. Incorrect usage of comma operator in the if statement: The if statement seems to be misused. It should contain a condition that evaluates to either true or false. Instead, it contains multiple variables separated by commas, which is not meaningful in this context. It's not clear what you intended to do with the if statement, but as it stands, it doesn't serve any purpose.

  2. Incorrect input syntax: The input statements have some issues. When you use the cin function, you don't need to use >> for each variable multiple times. Instead, you can use a single line of cin statement for each set of inputs.

  3. Incorrect variable assignments: There are some incorrect variable assignments. For example, you calculate v and then immediately override it with d1 + d2, without having calculated d1 and d2 yet. Additionally, you have some statements like o1, o2, d1, d2; ~0,001;, which are not valid in C++.

  4. Uninitialized variables: Some variables, like d1 and d2, are being used before they are assigned any value, leading to undefined behavior.

To correct these issues, let's make the necessary adjustments:

cpp
#include <iostream> #include <cmath> using namespace std; int main() { double ab, ad, ax, ay, bx, by, dx, dy, cx, cy, o1, o2, d1, d2, v; cout << "Enter ax ay: "; cin >> ax >> ay; cout << "Enter bx by: "; cin >> bx >> by; cout << "Enter cx cy: "; cin >> cx >> cy; cout << "Enter dx dy: "; cin >> dx >> dy; ab = bx - ax; ad = ay - dy; v = 2 * (ab * ab + ad * ad); d1 = d2 - ad; o1 = ad; o2 = ab; // If you intended to use comma as a decimal separator, use it like this: // cout << fixed << setprecision(3) << v; cout << "v = " << v << endl; // Output other variables if needed. return 0; }

Please note that the code still lacks clarity in some areas. I'm not sure what you intended to calculate, so you may need to adjust it further based on your specific requirements. Additionally, if you meant to use a comma as a decimal separator, you need to adjust the output accordingly (e.g., using cout << fixed << setprecision(3) << v;).

0 0

Похожие вопросы

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос