Added Makefile

Added lib 'int2str.c'
Added 'main.c'
This commit is contained in:
arcan1s
2013-07-17 03:58:22 +04:00
parent 25da8b87e3
commit 709c4564c6
10 changed files with 391 additions and 64 deletions

26
stat_new/int2str.c Normal file
View File

@ -0,0 +1,26 @@
/* Library for converting integer to string
* Usage
* char = conv (number, position)
*/
#include <stdio.h>
#include <stdlib.h>
char conv (int fnumb, int dig_pos)
/* fnumb - integer
* dig_pos - position
*/
{
int d, h, o;
char const digit[] = "0123456789";
h = fnumb / 100;
d = (fnumb % 100) / 10;
o = fnumb % 10;
if (dig_pos == 1) return digit[o];
if (dig_pos == 2) return digit[d];
if (dig_pos == 3) return digit[h];
else return digit[0];
}