Jump to content

simple prog


ch1zra

Recommended Posts

Evo ti standalone exe, da se ne jebavas sa bibliotekama.

http://rapidshare.com/files/284225937/hemija.exe

{$APPTYPE CONSOLE}


uses

  Windows;


var

  Sc, Si, P, C : Real;

  hndConsole   : THandle;

  Coord		: TCoord;

  lwWritten	: DWORD;


begin

  Coord.X := 0;  Coord.Y := 0;


  repeat

	WriteLn('************************');

	WriteLn('*	Racunanje Sc-a	*');

	WriteLn('************************');

	WriteLn;


	Write('Vrednost Si: ');  ReadLn(Si);

	Write('Vrednost P:  ');  ReadLn(P);

	Write('Vrednost C:  ');  ReadLn(C);

	WriteLn;


	WriteLn('========================');

	WriteLn('  Si = ', Si:0:3);

	WriteLn('  P  = ', P:0:3);

	WriteLn('  C  = ', C:0:3);

	WriteLn('========================');

	WriteLn;


	Sc := C / (4.36 - ((Si + P) * 0.32));


	WriteLn('Sc = C / (4.26 - ((Si + P) * 0.32)) = ', Sc:0:3);

	ReadLn;


	hndConsole := GetStdHandle(STD_OUTPUT_HANDLE);

	FillConsoleOutputCharacter(hndConsole,

							   ' ',

							   GetLargestConsoleWindowSize(hndConsole).X * GetLargestConsoleWindowSize(hndConsole).Y,

							   Coord,

							   lwWritten);

	SetConsoleCursorPosition(hndConsole, Coord);

  until 1 <> 1;							 

end.

Link to comment
Share on other sites

Napravio sam mu ja u C-u eve koda pa ako neko ima bolju ideju nek prepravi.

#include<stdio.h>

#include<windows.h>

#include<ctype.h>


#define KON1 4.36

#define KON2 0.32


main(){


float VrednostSi = 0, VrednostP = 0, VrednostC = 0, Rezultat = 0;


	while(1){


		system("cls");


		printf("Sc = C / (4.26 - ((Si + P) * 0.32))\n\n");


		do{


		printf("Unesite vrednost Si:\t");


		fscanf(stdin,"%f",&VrednostSi);


		}while(VrednostSi < 0);


			if (GetAsyncKeyState(VK_ESCAPE)) {

						return 0;

						 }




		do{


		printf("\nUnesite vrednost P:\t");


		fscanf(stdin,"%f",&VrednostP);


		}while(VrednostP < 0);


			if (GetAsyncKeyState(VK_ESCAPE)) {


			return 0;


			}




		do{


		printf("\nUnesite vrednost C:\t");


		fscanf(stdin,"%f",&VrednostC);


		}while(VrednostC < 0);


			if (GetAsyncKeyState(VK_ESCAPE)) {


			return 0;


			}




		Rezultat = VrednostC/(KON1-((VrednostSi + VrednostP)*KON2));




		printf("\nRezultat Sc je:\t%.2f\n",Rezultat);




			if (GetAsyncKeyState(VK_ESCAPE)) {


			return 0;


			}




		system("PAUSE");






	}


 return 0;




}

Link to comment
Share on other sites

lol :)

Realno za ovo fortran... [:D]

Napravio sam mu ja u C-u eve koda pa ako neko ima bolju ideju nek prepravi.

#include<stdio.h>

#include<windows.h>

#include<ctype.h>


#define KON1 4.36

#define KON2 0.32


main(){


float VrednostSi = 0, VrednostP = 0, VrednostC = 0, Rezultat = 0;


	while(1){


		system("cls");


		printf("Sc = C / (4.26 - ((Si + P) * 0.32))\n\n");


		do{


		printf("Unesite vrednost Si:\t");


		fscanf(stdin,"%f",&VrednostSi);


		}while(VrednostSi < 0);


			if (GetAsyncKeyState(VK_ESCAPE)) {

						return 0;

						 }




		do{


		printf("\nUnesite vrednost P:\t");


		fscanf(stdin,"%f",&VrednostP);


		}while(VrednostP < 0);


			if (GetAsyncKeyState(VK_ESCAPE)) {


			return 0;


			}




		do{


		printf("\nUnesite vrednost C:\t");


		fscanf(stdin,"%f",&VrednostC);


		}while(VrednostC < 0);


			if (GetAsyncKeyState(VK_ESCAPE)) {


			return 0;


			}




		Rezultat = VrednostC/(KON1-((VrednostSi + VrednostP)*KON2));




		printf("\nRezultat Sc je:\t%.2f\n",Rezultat);




			if (GetAsyncKeyState(VK_ESCAPE)) {


			return 0;


			}




		system("PAUSE");






	}


 return 0;




}

Ti si matori opro kolko si ga presvirao

poz voz 2011

Link to comment
Share on other sites

Jel ovo takmičenje "kako na što komplikovaniji način napraviti jednostavan program" ili šta? :)

bas vala

The people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...