1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
| #include <iostream> #include <cstdlib> #include <vector> #include <array> #include <iterator> #include <functional>
using namespace std;
constexpr int size(){return 100;}
void func(initializer_list<int> li) { cout << "func with " << li.size() << "elements" << endl; }
vector<int> func2() { return {1,2,3}; }
int main() { long long ll = 64;
int a = {0}; int bb{0}; vector<int> v2 = {1,2,3};
int *p = nullptr; int *p2 = 0; int *p3 = NULL;
constexpr int ci = 30; constexpr float cf = ci * 0.2; constexpr int sz = size();
using my_int = int; my_int i = 10;
using vi = vector<int>; vi v = {1,2,3,5};
using it = vector<int>::iterator; for (it it_i = v.begin(); it_i != v.end(); ++it_i) { cout << *it_i << endl; }
auto aa = 3;
decltype(i) id1 = 0; decltype((i)) id2 = id1;
string hello = "hello, world!"; for (auto c : hello) { cout << c << endl; }
vector<vector<int> > vv1; vector<vector<int>> vv2;
vector<int> vi10 = {4,4,54}; const vector<int> cvi10 = {4,4,54}; auto it10 = vi10.cbegin(); auto cit10 = cvi10.cbegin();
int ia[] = {1,3,4}; int *b = begin(ia); int *e = end(ia); func({1,2,3,4});
array<int, 3> a1 = {{1,2,3}}; auto aa1 = a1.begin();
int i20 = 233; string s20 = to_string(i20);
auto f211 = [] () {return 23;}; auto f212 = [i20]() {return i20 > 20;}; auto f213 = [i20]() -> int {if(i20> 20) return 1; else return 0;};
int i25 = 42; int && rr = i25*42;
int &&rr3 = std::move(rr);
class Last final {};
tuple<int, int, int> tt{1,2,4}; auto tt1 = get<0>(tt); auto tt2 = get<1>(tt); auto tt3 = get<2>(tt);
return 0; }
|