*   >> Læs Uddannelse artikler >> science >> programming

Konsol Application hjælp Konstruktioner ( struct søgeord) i C # 1.1 og 2.0 ( Dot Net )

//Console Application hjælp Konstruktioner ( struct søgeord) i C # 1.1 og 2.0 ( Dot Net )

< p> using System ; < br >

namespace Struc

< p> {

< p> class struk-

< p> {

< p> static void Main ( )

< p> {

studerendes = ny elev ();

< p> s.show1 ();

< p> s.name = Console.ReadLine ();

< p> s.roll = int .Parse ( Console.ReadLine ( )),

< p> s.fees = int.Parse ( Console.ReadLine ( )),

< p> s.show ();

< p> konsol .WriteLine ( "Navn : {0} \\ nRoll nr : {1} \\ nFees : {2 }" , s.name , s.roll , s.fees )

< p> Console.

ReadLine ();

< p> }

< p> }

< p> struct studerende

< p> {

< p> offentlige string navn Salg

offentlige float gebyrer < br >

offentlige int roll ;

< p> public void show ()

< p> {

< p> Console.WriteLine ( " Students Detail ")

< p> }

< p> public void show1 ()

< p> {

< p> Console.WriteLine ( " Indtast navn , Roll nej , gebyrer af de studerende .

")

< p> }

< p> }

< p> }


Copyright © 2008 - 2016 Læs Uddannelse artikler,https://uddannelse.nmjjxx.com All rights reserved.