This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Следить, чтобы файл был сохранен в кодировке windows-1251 (внизу IDE указана | |
//текущая кодировка. Можно выставить в Settings-Editor-Other Settings | |
// Use encoding when opening files: Windows-1251 | |
// и галку в as default encoding | |
#include <iostream> | |
#include <Windows.h> | |
using namespace std; | |
int main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nVar - int | |
lVar - long | |
fVar - float | |
dVar - double | |
cVar - character | |
szVar - string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int n1, n2, n3; | |
n1 = 5; | |
n2 = ++n1; // n1 = 6, n2 = 6 | |
n1 = 5; | |
n3 = n1++; // n1 = 6, n3 = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int n1, n2, n3; | |
n1 = 5; | |
bool b = (n1>4) && n1++>5; | |
cout << b << "\n"; // b = true && false = false (0) | |
cout << n1 << "\n"; //n1 = 6 | |
n1 = 5; | |
bool b = (n1>4) && ++n1>5; | |
cout << b << "\n"; // b = true && true = true (1) |