
- •Int main()
- •Int main()
- •Int choice(0);//Здесь сохранитть выбранное значение
- •Int main()
- •Int choice(0);//Здесь сохранитть выбранное значение
- •Int main()
- •Int choice(0);//Здесь сохранитть выбранное значение
- •Int main() {
- •Int choice(0);//Здесь сохранитть выбранное значение
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main (){
- •Int main (){
- •Int main (){
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main()
- •Int main(){
- •Int main(){
- •Int main(){
- •Int main() {
- •Int main(){
- •Int main(){
- •Int main(){
- •Int main(){
- •Int main(){
- •Int main(){
- •Int main (){
- •Int main(){
- •Int main(){
- •Int main (){
- •Int main(){
- •Int main(){
Int main()
{
float format;//
int kol; //
float cena,sum,discount=0,total;//
setlocale (LC_ALL,"Rus");
printf("\n_.::ФОТО::._\n");
printf("Формат(1-9х12;2-10х15)=");
scanf("%i",&format);
printf("Количество, шт.=");
scanf("%i",&kol);
if(format)
cena=2.50;
else
cena=3.20;
sum=cena*kol;
if(kol>10){
discount=sum*0.05;
total=sum-discount;}
printf("\n-----------------");
printf("\nЦена:%3.2f руб",cena);
printf("\nКоличество:%i",kol);
printf("\nСумма:%3.2f руб.",sum);
if(discount!=0){
printf("\nСкидка:%3.2f руб.",discount);
printf("\nК оплате:%3.2f руб.",total);}
printf("\n\nДля завершения нажмите <Enter>");
getch();
return 0;
}
// функция if задача 4.cpp: определяет точку входа для консольного приложения.
#include "stdafx.h"
#include <conio.h>
#include <clocale>
#include "math.h"
Int main()
{
float a,b,c,x1,x2,d;//
setlocale (LC_ALL,"Rus");
printf("\n Решение квадратного уравнения\n");
printf("Введите в одной строке знеачения коэффициентов ");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if(d<0)
printf("Уравнение не имеет решения\n");
else {
x1=(-b + sqrt(d))/(2*a);
x1=(-b - sqrt(d))/(2*a);
printf("\nКорни уравнения:x1=%3.2fx2%3.2f\n",x1,x2);}
printf("\n\nДля завершения нажмите <Enter>");
getch();
return 0;
}
// функция if задача 5.cpp: определяет точку входа для консольного приложения.
#include "stdafx.h"
#include <conio.h>
#include <clocale>
Int main()
{
float summ;//
setlocale (LC_ALL,"Rus");
printf("\nВычисление стоимости покупки с учетом скидки\n");
printf("Введите сумму покупки и нажмите <Enter>");
printf(">>");
scanf("%f",&summ);
if(summ<500)
printf("Скидка не предоставляется\n");
else {
printf("Скидка предоставляется");
if(summ>1000){
printf("5%\n");
summ=0.97*summ;}
else {
printf("3%\n");
summ=0.97*summ;}
printf("\nК оплате:%3.2f руб.\n",summ);}
printf("\n\nДля завершения нажмите <Enter>");
printf("\n---------------------------------");
getch();
return 0;
}
// весокосный год.cpp: определяет точку входа для консольного приложения.
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <clocale>
using std::cin;
using std::cout;
using std::endl;
Int main()
{
int a,res;
setlocale (LC_ALL,"Russian");
cout
<<"Является ли год весакосным.\n----------------------------------"
<<"\nВведите год:";cin>>a;
res=a%4;
if (res)
cout<<endl
<<"\nГод является не весакосным."<<endl;
else
cout
<<"\nГод является весакосным."<<endl;
cout<<"\nДля завершения нажмите <Enter>"
<<endl <<"----------------------------------";
getch();
return 0;
}
// правильное вычитание.cpp: определяет точку входа для консольного приложения.
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <clocale>
using std::cin;
using std::cout;
using std::endl;
Int main()
{
int a,b,d,res;
setlocale (LC_ALL,"Russian");
cout
<<"Пограмма проверки знаний.\n----------------------------------";
cout<<"\nВведите первое число:";cin>>a;
cout<<"\nВведите второе число:";cin>>b;
cout<<"\nВведите ответ:";cin>>d;
res=a-b;
if (res==d)
cout<<endl
<<"\nВы ответили правильно."<<endl;
else
cout<<"\nВы ответили неправильно ,правильно :."<<res;
cout<<"\nДля завершения нажмите <Enter>"
<<endl <<"----------------------------------";
getch();
return 0;
}
// таблица умножения.cpp: определяет точку входа для консольного приложения.
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <clocale>
using std::cin;
using std::cout;
using std::endl;