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 <cstdio> | |
#include <unordered_map> | |
#include <vector> | |
#include <cstring> | |
#include <memory> | |
const std::string sample = "MCMLXXII"; | |
struct ROMAN_NUMERALS | |
{ |
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 <cstdio> | |
#include <xmmintrin.h> | |
__m128 addWithAssembly(const __m128 a, const __m128 b) | |
{ | |
__asm addps xmm0, xmm1 | |
} | |
__m128 addWithIntrinsics(const __m128 a, const __m128 b) | |
{ |
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 <stdio.h> | |
#include <time.h> | |
int main() | |
{ | |
time_t start, now; | |
double secs = 0.0; | |
int timercountdown = 10; | |
start = now = time(NULL); |
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 <cstdio> | |
#include <cstdlib> | |
#include <cmath> | |
#include <vector> | |
int main(int argc, char* argv[]) | |
{ | |
if(argc == 1) | |
return 0; |
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 <cstdio> | |
#include <vector> | |
#include <algorithm> | |
typedef void (*func)(); | |
void Func1() | |
{ | |
std::puts("Func1() called."); | |
} |
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 <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
int my_atoi(const char* snum) | |
{ | |
int idx, strIdx = 0, accum = 0, numIsNeg = 0; | |
const unsigned int NUMLEN = (int)strlen(snum); | |
/* Check if negative number and flag it. */ |
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 <stdio.h> | |
#include <string.h> | |
#define MAX_ROMAN_NUMERALS 100 | |
struct ROMAN_NUMERALS | |
{ | |
char letter; | |
int value; | |
}; |
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 <iostream> | |
#include <vector> | |
#include <map> | |
using namespace std; | |
class CBaseConverter | |
{ | |
public: | |
CBaseConverter(){} |
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 <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
int main(int argc, char** argv) | |
{ | |
int digits; | |
digits = (atoi(argv[1]) == 0) ? 1 : (int)log10(abs(atoi(argv[1]))) + 1; |