home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
servis
/
tipy
/
web
/
teplomer
/
tep.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-02-29
|
2KB
|
74 lines
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
int i,j;
char vstup[20];
char datum[40];
float vstupy;
int tisk(void)
{
FILE *f;
f=fopen("akt_tep.html","w");
fprintf(f, "<html>");
fprintf(f, "<head>");
fprintf(f, "<meta http-equiv=""Content-Type""");
fprintf(f, "content=""text/html; charset=windows-1250"">");
fprintf(f, "<meta http-equiv=""Refresh"" content=""62"">");
fprintf(f, "<title>");
fprintf(f, "%4.1f", vstupy);
fprintf(f, "░C HELIUM Teplom∞r</title>");
fprintf(f, "</head>");
fprintf(f, "<body bgcolor=""#FBCF86"">");
/* fprintf(f, "<body background=""hel.jpg"">"); */
fprintf(f, "<hr>");
fprintf(f, "<h2 align=""center""><font color=""#007A9C"" size=""6""><strong>HELIUM Teplom∞r</strong></font></h2>");
fprintf(f, "<hr>");
fprintf(f, "<p align=""center"">Pr∙m∞rnß teplota ");
fprintf(f, "%s", datum);
fprintf(f, "</p>");
/* fprintf(f, "<p align=""center"">( zkuÜebnφ provoz )</p>"); */
fprintf(f, "<p align=""center""><font color=""#FF0000"" size=""7""><strong>");
fprintf(f, "%4.1f", vstupy);
fprintf(f, "░C</strong></font></p>");
fprintf(f, "<p align=""center""><font size=""3"">(pro aktußlnφ teplotu zvolte ");
fprintf(f, "obnovit-refresh)</font></p>");
fprintf(f, "<hr>");
fprintf(f, "</body>");
fprintf(f, "</html>");
fclose(f);
return(0);
}
int main()
{ FILE *f_log;
time_t timer;
struct tm *tblock;
for(i=0; i<=3; j++)
{
/* prumer z deseti hodnot */
vstupy=0;
for(j=0; j<=7; j++)
{ scanf("%20s", vstup);
vstupy=vstupy+atof(vstup); }
vstupy=vstupy/8.0-1;
timer = time(NULL); /* gets time of day */
tblock = localtime(&timer); /* converts date/time to a structure */
strcpy(datum, asctime(tblock));
/* printf("Local time is: %s", datum); */
f_log=fopen("teplota.log","a+");
fprintf(f_log, "%6.1f - %s", vstupy, datum);
fclose(f_log);
tisk();
}
return(0);
}