| #include "stdafx.h" #include "iostream" #include "vector" #include "string" #include "fstream" #include "windows.h" using namespace std; intmain() { int ten = 10; cout << ( float)ten / 11 << endl; cin.get(); return 0;} #include "stdafx.h" int main() { const double GoldNumber = 1.6180; const double NumberPi = 3.1415; char somechar = 'A'; bool IBestProgSpecialist = true int myage = 17; float FavNum = 1.6180; double otherFavNum = 3.1415; cout << "My favourite number is: " << FavNum << "and, of course: " << otherFavNum << endl; Sleep(5000); return 0; } #include"stdafx.h" #include "iostream" #include "vector" #include "string" #include "fstream" using namespace std; int main(){ int ten = 10; cout << ten / 11 << endl; cin.get(); return 0;} #include "iostream" intmain(){ int ten = -50; int res1 = ++ten; int res2 = ten++; int res3 = --ten; int res4 = ten--; cout << "++" << ten << " = " << res1 << endl; cout << ten << "++ = " << res2 << endl; cout << "--" << ten << " = " << res3 << endl; cout << ten << "-- = " << res4 << endl; cin.get(); return 0; } #include "vector" #include "iostream" intmain() { bool Canprog = true; char Name[2] = { 'D', 'A' }; int somenums[3] = { 23, 23, 42}; if (somenums[1] > somenums[0]) { cout << somenums[1] << endl; } else if (somenums[1] < somenums[0]) { cout << somenums[0] << endl; } else { cout << somenums[2] << endl; } // output commands // cout << "Cout: " << somenums[1] << endl; cin.get(); return 0;} intmain() { int languageOption = 0; switch (languageOption) { case 1: cout << "Bonjour!" << endl; break; case 2: cout << "hello!" << endl; break; case 3: cout << "greetings!" << endl; break; default: cout << "hi" << endl; break; } cin.get(); return 0; #include "stdafx.h" #include "iostream" #include "vector" intmain() { int lol = 5; //variable = (condition) ? true : false; bool test = (lol <= 5) ? true : false; cout << test << endl; cin.get(); return 0; } |
Комментарии