.main:hover ul {
top: 24px;
}
ul {
translition: 1s;
}
#include <curses.h>
#include <unistd.h>
#include <cstdlib>
#define bRead(value, bit) (((value) >> (bit)) & 0x01)
#define bWrite(value, bit, bitvalue) (bitvalue ? (value) |= (1UL << (bit)) : (value) &= ~(1UL << (bit)))
int main() {
initscr();
char map = 0; /////////!
for (int i = 0; i < 10; ++i) {
bWrite(map, 0, rand() % 2);
for (int j = 7; j >= 0; --j) {
addch((bRead(map, j) ? '#' : '_'));
}
map <<= 1; /////////
refresh();
sleep(1);
clear();
}
endwin();
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int cs[] = {1, 2, 5, 10, 50, 100, 200, 500, 1000, 2000, 5000}, s;
void f(int sq, int i, string v) {
if (sq == 0) cout << v << "\n";
else if (sq > 0 && i >= 0) {
f(sq - cs[i], i, v + (v == "" ? " " : "+") + to_string(cs[i]));
f(sq, i - 1, v);
}
}
int main() {
cin >> s;
f(s, sizeof(cs)/sizeof(cs[0]) - 1, "");
return 0;
}