Skip to content

Instantly share code, notes, and snippets.

@SergXIIIth
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SergXIIIth/9807230 to your computer and use it in GitHub Desktop.
Save SergXIIIth/9807230 to your computer and use it in GitHub Desktop.
Lab_1
#include <iostream>
#include <conio.h> // В этой библиотеке "живет" - getch();
/*
Исходные данные
---------------
Сумма вклада
Срок вклада, в месяцах
*/
using namespace std;
int main()
{
float amount;
int period;
printf("Доход\n"); // "\n" в конце означает перейти на новую строку
// Ввод данных с клавиатуры
printf("Сумма, руб. -> ");
// чтение клавиатуры, "%f" значит что ожидается получить
// число с дробной частью
scanf("%f", &amount);
printf("Срок вклада, мес. -> ");
// чтение клавиатуры, "%i" значит что ожидается получить
// целое число
scanf("%i", &period);
// Показ введенных данных
printf("\nCумма: %.02f руб.\n", amount);
printf("Срок вклада: %i мес.\n", period);
printf("\nНажмите любую клавишу для выхода");
getch(); // В стандарте C++ этой фунции нет. Это только для Microsoft, Borland С++
return 0;
}
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
printf("Волкова\nЕкатерина\nГочевна\n\n");
printf("Волков\nГоча\nАндреевич\n\n");
printf("Волкова\nОльга\nВладимировна\n");
printf("\nНажмите любую клавишу для выхода");
getch();
return 0;
}
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
float radius;
printf("Пожалуйста введите РАДИУС -> ");
scanf("%f", &radius);
printf("Вы ввели РАДИУС: %.02f", radius);
printf("\nНажмите любую клавишу для выхода");
getch();
return 0;
}
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
float a;
float h;
printf("Пожалуйста введите размер стороны (a) -> ");
scanf("%f", &a);
printf("Пожалуйста введите размер высоты (h) -> ");
scanf("%f", &h);
printf("\nПлощадь параллелограмма равна %.02f\n", a * h);
printf("\nНажмите любую клавишу для выхода");
getch();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment