Написать программу, которая считывает с клавиатуры два целых числа и выводит их частное c++
226
228
Ответы на вопрос:
#include "iostream"
#include "stdlib.h"
#include "locale.h"
using namespace std;
int main(){
setlocale(lc_all,"rus");
int a, b;
cout < < "введите число a: "; cin > > a;
cout < < "введите число b: "; cin > > b;
if(b ! = 0){
cout < < "частное: " < < a/b < < endl;
}else cout < < "ошибка! деление на 0! " < < endl;
system("pause");
return 0;
}
Var a,b,c: real; begin readln(a,b,c); if (b> 0) and (a > 0) and (c > 0) then write((c+a+b): 0: 0); if (b> 0) and (a> 0) and (c< 0) then write((a+b): 0: 0); if (b> 0) and (a< 0) and (c> 0) then write((b+c): 0: 0); if (b< 0) and (a> 0) and (c> 0) then write((a+c): 0: 0) end.
Популярно: Информатика
-
винишко1205.02.2021 09:51
-
vashik047p08sj508.04.2022 11:59
-
Виктория8080501.11.2022 05:51
-
7ag18.05.2022 03:41
-
karinasing28.12.2021 07:09
-
29101975tanuxa08.06.2022 14:55
-
airatfack2000oz7glu24.09.2022 21:30
-
Денок0710.10.2020 14:11
-
182838485807.08.2022 09:47
-
Владимирович1121.11.2022 22:29