Text: |
ԲΠ= Ãîðáà÷åíêî Â.À.
Çàïèòàííÿ:// ÏÎÄÊËÞ×ÅÍÍÛÅ ÁÈÁËÈÎÒÅÊÈ
#include <iostream> // ÁÈÁËÈÎÒÅÊÀ ÂÂÎÄÀ/ÂÛÂÎÄÀ
#include <math.h> // ÁÈÁËÈÎÒÅÊÀ  ÊÎÒÎÐÎÉ ÍÀÕÎÄßÒÜÑß ÌÀÒÅÌÀÒÈ×ÅÑÊÈÅ ÔÓÍÊÖÈÈ
#include <stdio.h> // ÁÈËÈÎÒÅÊÀ ÂÂÎÄÀ/ÂÛÂÎÄÀ
using namespace std; // ÒÀÊ ÍÀÄÎ äëÿ cout è äëÿ cin
//------------------------------------------------------------------------------
int main()
{
/*
ÑÎÇÄÀÍÈÅ ÏÅÐÅÌÅÍÍÛÕ
<ÒÈÏ> <ÍÀÇÂÀÍÈÅ>;
<ÒÈÏ> <ÍÀÇÂÀÍÈÅ> = <ÇÍÀ×ÅÍÈÅ>;
ÒÈÏÛ:
ÖÅËÛÅ:
int [-32764; 32765 ] 2 áàéòà
long [+/- 1048576] 4 áàéòà
-> áåçíàêîâûé unsigned -----> unsigned int
ÄÐÎÁÍÛÅ:
float 2 áàéòà
double 4 áàéòà
ËÎÃÈ×ÅÑÊÈÅ 1 áèò, à âîáùå 1 áàéò
bool
ÑÈÌÂÎËÜÍÛÅ
char 1 áàéò
string ïîêà íå íàäî. 256 ÕÇ...
--------------------------------
ÊÀÊ ÐÀÁÎÒÀÒÜ
<ÍÀÇÂÀÍÈÅ> = <ÍÎÂÎÅ ÇÍÀ×ÅÍÈÅ>;
a = 10;
ÕÎÒÈÌ ÓÂÅËÈ×ÈÒÜ ÇÍÀ×ÅÍÈÅ ÏÅÐÅÌÅÍÍÎÉ ÍÀ 1
<ÍÎÂÎÅ ÇÍÀ×ÅÍÈÅ ÏÅÐÅÌÅÍÍÎÉ> = <ÑÒÀÐÎÅ ÇÍÀ×ÅÍÈÅ ÏÅÐÅÌÅÍÍÎÉ> + 1;
<ÍÀÇÂÀÍÈÅ>++;
Ïðèìåðû:
a = a + 1; //////// ÏÐÈÌÅÐ: a=10; => 11 = 10 + 1;
a += 1;
a++;
-------
a--;
*/
int a = 20;
int b = 5 ;
int c,d,e,f;
c = a + b;
d = a - b;
e = a / b;
f = a * b;
// òî ÷òî â "..." ýòî òåêñò, åñëè òî÷íåå òî ñòðîêà èëè æå ìàññèâ ñèìâîëîâ
cout<< " a = " <<a<<endl;
cout<< " b = " <<b<<endl;
cout<<endl;
cout<< " c = " <<c<<endl;
cout<< " d = " <<d<<endl;
cout<< " e = " <<e<<endl;
cout<< " f = " <<f<<endl;
system("pause");
return 0;
}
====================================
|