Jump to content
Sign in to follow this  
Dominik.

Kod napisany w C dziala tylko w CodeBlocks

Recommended Posts

Witam posiadam taki oto kod:

 

http://wklej.org/id/3013248/ 

 

char *na_rzymskie[4][9] = {"I","II","III","IV","V","VI","VII","VIII","IX",
                            "X","XX","XXX","XL","L","LX","LXX","LXXX","XC",
                            "C","CC","CCC","CD","D","DC","DCC","DCCC","CM",
                            "M","MM","MMM"};

char rzymska[7] = {'I','V','X','L','C','D','M'}; //liczba rzymska
unsigned w_rzym[7] = {1,5,10,50,100,500,1000}; //wartosc liczby rzymskiej // w_rzym

char *a_na_rz(int input);
int rz_na_a(char *input);

// konwersja arabskich na rzymskie
char *a_na_rz(int input)
{
	int count,point,r;
	char wynik[80]={"\0"};

	for(count=1000,point=3; count>=1; count=count/10,point--)
	{

		r = input/count;
		if (r >= 1)
		{
			input = input % count;
			strcat(wynik,na_rzymskie[point][r-1]);
		} //koniec if
	} //koniec for
	return (wynik);
}

 

Działa poprawnie w programie CodeBlocks, lecz w innym, np. Visual Studia nie dziala porawnie. Co może być zle, co do poprawy?

 

Dołączam taki ss , bo nir ma mnie na kompie. 

image

Share this post


Link to post

Masz jak byk - deprecated. Uzyj innej funkcji bo ta, której używasz jest przestarzała.

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Create a New Account. It’s free and easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...