You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
// ========================================================================
|
|
//
|
|
// Copyright (C) 2016-2017 MARC CHEVALDONNE
|
|
// marc.chevaldonne.free.fr
|
|
//
|
|
// Module : Program.cs
|
|
// Author : Marc Chevaldonné
|
|
// Creation date : 2016-09-22
|
|
//
|
|
// ========================================================================
|
|
|
|
using System;
|
|
|
|
|
|
namespace ex_004_007_DureeDeVie
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
int a = 2;//la pile contient ... a
|
|
|
|
int b = 3;//la pile contient ... a b
|
|
|
|
float f = 10;//la pile contient ... a b f
|
|
|
|
{
|
|
int c = a + b; //la pile contient ... a b f c
|
|
f /= c; //f est modifié, la pile contient ... a b f c
|
|
}//c meurt ici, la pile contient ... a b f
|
|
|
|
TimeSpan ts = TimeSpan.FromHours(2); //la pile contient ... a b f ts
|
|
|
|
{
|
|
TimeSpan ts2 = ts - TimeSpan.FromHours(1); //la pile contient ... a b f ts ts2
|
|
}//ts2 meurt ici, la pile contient ... a b f ts
|
|
|
|
|
|
}//a, b, f, ts meurent ici, la pile contient ...
|
|
}
|
|
}
|