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
QList<QVector<int> > resultContainter; | |
QVector<int> Calculate(int begin, int end) | |
{ | |
QVector<int> localResult(30); | |
for (int i = begin; i < end; ++i) | |
{ | |
localResult[aData[i]]++; | |
} | |
return localResult; |
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> | |
const int N = 5; | |
int count = 1; | |
void spiralPrint(int end_row, int end_col, int arr[N][N]) | |
{ | |
int start_row = 0, start_col = 0; | |
while (start_row < end_row && start_col < end_col) |
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
/* STATIC POLYmorphysm */ | |
#include <iostream> | |
template<typename T> | |
class Base | |
{ | |
public: | |
void printName() | |
{ | |
static_cast<T*>(this)->printName(); |
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> | |
class BinaryList | |
{ | |
struct tree_node | |
{ | |
int value; | |
tree_node *left; | |
tree_node *right; |
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> | |
/* Factorial template implementation */ | |
template <size_t N> struct fact; | |
template <> struct fact<0> | |
{ | |
const static size_t value = 1; | |
}; |
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 <exception> | |
template <typename T> | |
class Stack | |
{ | |
public: | |
Stack() : m_top(NULL), m_size(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 <iostream> | |
void checkWrongExpression() | |
{ | |
char ch = std::cin.get(); | |
if (ch == '\n') | |
{ | |
std::cin.putback(ch); | |
return; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>FaceBook LogIn</title> | |
<link rel="stylesheet" href="https://bootswatch.com/flatly/bootstrap.min.css"> | |
<style media="screen"> | |
#fb-btn { | |
margin-top: 20px; | |
} |
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 <cstring> | |
class MatricFactory | |
{ | |
public: | |
int** createArray(int row, int col, int initial = 0) | |
{ | |
int **arr = new int* [row]; | |
for (int i = 0; i < row; i++) |
NewerOlder