Skip to content

Instantly share code, notes, and snippets.

@kirilltobola
Last active October 14, 2021 17:58
Show Gist options
  • Save kirilltobola/1d536297359e69e693222b835f0d74da to your computer and use it in GitHub Desktop.
Save kirilltobola/1d536297359e69e693222b835f0d74da to your computer and use it in GitHub Desktop.
HW ЯП лекция2
#include <iostream>
int main()
{
int a = 157;
int c = 0365;
int d = 36'000'000;
int e = 0377;
int g = 0x3fff;
int h = 0X3FFF;
unsigned i = 328u;
long j = 0x7FFFFFL;
unsigned long k = 0776745ul;
auto l = 108LL;
auto m = 0x8000000000000000ULL << 16;
long long n = 24'847'458'121;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << 2000000000 + 1000000000 << endl;
cout << 2000000000U + 1000000000U << endl;
cout << 2500000000U + 2500000000U << endl;
cout << 2500000000LL + 2500000000LL << endl;
cout << 20000U * 200000U << endl;
cout << 200000U * 200000U << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << 5 / 2 << endl;
cout << 5.0 / 2;
return 0;
}
#include <iostream>
int main()
{
int a, b;
std::cin >> a >> b;
std::cout << a + b;
return 0;
}
#include <iostream>
namespace first {
int x;
namespace second {
int y;
}
}
int main()
{
first::x = 1;
first::second::y = first::x + 1;
using first::x;
std::cout << x << ' ' << first::second::y << std::endl;
using namespace first;
std::cout << x << ' ' << first::second::y << std::endl;
using namespace std;
cout << x << ' ' << first::second::y << endl;
return 0;
}
start = 'a'
val = 1
for i in range(27):
for j in range(100):
vars()[start + str(j)] = val
val += 1
start = chr(ord(start) + 1)
print(z99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment