Ro/Rodin/Alte exemple

From HaskellWiki
< Ro/Rodin
Revision as of 05:32, 25 November 2008 by Ha$kell (talk | contribs) (Ather example in test)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Program incercat in timpul testarii RodinV082b. Se observa cateva probleme.

{	text "Dati lungimea vectorului";

	citeste n;

	pentru (fie x=0; x<n; fie x=x+1)

		fie v[x]=0;

	pentru (fie x=0; x<n; fie x=x+1)

		'''{citeste y;fie v[x]=y;};'''

	fie xmin=0;

	fie xmax=0;

	pentru (fie x=0; x<n; fie x=x+1)

		{daca (xmin>v[x]) atunci fie xmin=v[x];

							altfel '''fie xmin=xmin;'''};

	'''pentru ('''fie x=0; x<n; fie x=x+1)

		{daca (xmax<v[x]) atunci fie xmax=v[x];

							altfel '''xmax=xmax;'''};

	text "Minimul din sir este";

	scrie xmin;

	text "Maximul din sir este";

	scrie xmax;

	citeste j;

	};

Beta tester: Cristina (88). Multumesc mult pentru exemplu.