/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/csharp/snippets/methods/params74.cs
24 строки
536 B
Bill Wagner
Add params collections (#40978)
21 май 2024, 00:01
Не верифицирован
21 май 2024, 00:01
57cbe8e
Код
Авторство
О чём код?
//<Snippet74> public static class SquareExample { public static void Main() { // Call with an int variable. int num = 4; int productA = Square(num); // Call with an integer literal. int productB = Square(12); // Call with an expression that evaluates to int. int productC = Square(productA * 3); } static int Square(int i) { // Store input argument in a local variable. int input = i; return input * input; } } //</Snippet74>