This repository has been archived on 2023-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
mipt_cpp/seminar01_overload/classroom_tasks/code/00namespace/01namespace_solution.cpp

26 lines
348 B
C++
Raw Normal View History

2022-09-01 16:37:41 +03:00
#include <stdio.h>
namespace mipt
{
int a = 5;
float b = 1.2;
int square(int x)
{
return x * x;
}
float average(float x, float y)
{
return (x + y) / 2;
}
}
int main()
{
printf("%i\n", mipt::square(mipt::a));
printf("%f\n", mipt::average(mipt::a, mipt::b));
}