ADAM5510 :
. ,
, 4 ,
.
.
IBM PC
ADAM5510 80188
ROMDOS, MSDOS
, BIOS,
IBM PC ,
.
ADAM5510
, .
170 . ,
192
.
RSC232/485
ADAM5510
,
.
1 RS232, 2
RS485.
.
ADAM5510 ,
: 3000
, 2500
.
,
, ,
,
.
.__
8. / Turbo C++: scanf(), printf(), getch(). ADAM5510M.
/:
int scanf (const char* format, )//
int printf (const char* format, )//
/ format.
:
, ( ) ( ) ;
|
|
, %, .
#include <stdio.h>/* , -*/
int main()
{
int i; //
printf("Vvedite celoe chislo\n");//
scanf("%d", &i); /* scanf i ( & - ) */
printf("Vu vveli chislo %d, spasibo!\n", i); /* printf , */
return 0;
}
Printf()
:
#include <stdio.h>
/*int printf ( [, ]); */
printf() , . .
, , %.
% .
, . :
% [][][.][]
, .
: %
, %d.
. , printf() , .
1.
s | |
d | int( ) |
o | int( ) |
u | unsigned int ( ) |
x | int ( ) |
f | float, double ( ) |
[][.] , , .
, %5d , %15.5f 15 , .
.
#include <stdio.h>
#define square(x) ((x) * (x))
#define pi 3.1415926
void main()
{
float x = 2.5;
int i = 11;
int j = 119;
printf ("\n 2.5 = %10.4f", square(x)); /*
square(x) */
printf ("\n =%10.4f", pi);
printf ("\n\n 11=%x", i); /* i */
printf ("\n\n 119=%x", j);
printf ("\n\n 119=%o \n", j);
}
:
2.5 = 6.2500
= 3.1416
11= b
|
|
119= 77
119=167
Getch()
:
#include <conio.h>
int getch(void);
( ). .
#include <conio.h>
#include <stdio.h>
#define ESC 27
void main(void)
{
clrscr();
if(getch()!=ESC)
printf("Simvol vveden\n"); /* ESC*/
else
printf("Simvol ne vveden \n");/* ESC*/
return 0;
}