Using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace zn { class Program { public static void Main(string[] args) { Console.Write("Введите кол-во минут по тарифу: "); int a = Convert.ToInt32(Console.ReadLine()); Console.Write("Введите цену за минуту по тарифу: "); int b = Convert.ToInt32(Console.ReadLine()); Console.Write("Введите цену за минуту сверх тарифа: "); int c = Convert.ToInt32(Console.ReadLine()); Console.Write("Введите время пользования услугами связи за месяц в минутах: "); int d = Convert.ToInt32(Console.ReadLine()); int res = a > d ? a * b : a * b + (d - a) * c; Console.WriteLine("Плата за пользование: " + res); Console.ReadKey(); } } }
using namespace std; //подключение пространства имён std - открывает //доступ к cin и cout из библиотеки iostream
int main() //начало программы { SetConsoleCP(1251); //если будешь компилировать SetConsoleOutputCP(1251); //то это для подключения русского языка в консоли
float x, y, z; //объявление вещественных переменных cout<<"Введите значение X"; //вывод строки cin>>x; //вводим число y=sqrt(x); //считаем y if ((x<3) || (x>8)) //условие. если (x<3 или x>8) z=x*y; //есил истино z=x*y else z=x+y; //иначе z=x+y
cout<<"z= "<<z; //вывод результата
cout<<"Для завершения программы нажмите любую клавишу..."; cin.get(); cin.get(); return 0; }
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace zn
{
class Program
{
public static void Main(string[] args)
{
Console.Write("Введите кол-во минут по тарифу: ");
int a = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите цену за минуту по тарифу: ");
int b = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите цену за минуту сверх тарифа: ");
int c = Convert.ToInt32(Console.ReadLine());
Console.Write("Введите время пользования услугами связи за месяц в минутах: ");
int d = Convert.ToInt32(Console.ReadLine());
int res = a > d ? a * b : a * b + (d - a) * c;
Console.WriteLine("Плата за пользование: " + res);
Console.ReadKey();
}
}
}