-
-
Save AlexDenisov/543da61e0ef6250d5f490f2464c52e9b to your computer and use it in GitHub Desktop.
This file contains 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
#pragma once | |
#define m(x) x | |
class CPlusPlus { | |
public: | |
int foobar(int x) { | |
if (x > 0) { | |
return x + x; | |
} | |
return x * 14; | |
} | |
}; | |
This file contains 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
#include "header.h" | |
int f(int a, int b) { | |
int r = 0; | |
if (a > b) { | |
r += a; | |
} | |
if (a >= b) { | |
r += b; | |
} | |
if (a < b) { | |
r += a * 2; | |
} | |
if (a <= b) { | |
r += a * 12; | |
} | |
return r; | |
} | |
int ff(int x, int g) { | |
int *mem = new int[x]; | |
mem[0] = f(x, g); | |
for (int i = 1; i < x; i++) { | |
mem[i] = f(mem[i - 1], x); | |
} | |
int r = 0; | |
for (int i = 0; i < x; i++) { | |
r += mem[i]; | |
} | |
delete [] mem; | |
return r; | |
} | |
int fff(int a, int b) { | |
if (m(a > b)) { | |
return a; | |
} | |
return b; | |
} | |
int main() { | |
CPlusPlus cpp; | |
return cpp.foobar(44); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment