/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/starting3.cs
26 строк
736 B
Genevieve Warren
Move member remarks (#39270)
30 янв 2024, 00:43
Не верифицирован
30 янв 2024, 00:43
6c88824
Код
Авторство
О чём код?
using System; using System.Text; class Example16 { public static void Main() { // <Snippet33> int[] years = { 2013, 2014, 2015 }; int[] population = { 1025632, 1105967, 1148203 }; var sb = new System.Text.StringBuilder(); sb.Append(String.Format("{0,6} {1,15}\n\n", "Year", "Population")); for (int index = 0; index < years.Length; index++) sb.Append(String.Format("{0,6} {1,15:N0}\n", years[index], population[index])); Console.WriteLine(sb); // Result: // Year Population // // 2013 1,025,632 // 2014 1,105,967 // 2015 1,148,203 // </Snippet33> } }