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
// input | |
const arr1 = [ | |
["name", "id", "age", "weight", "Cool"], | |
["Susan", "3", "20", "120", true], | |
["John", "1", "21", "150", true], | |
["Bob", "2", "23", "90", false], | |
["Ben", "4", "20", "100", true], | |
]; | |
const arr2 = [ |
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> | |
using namespace std; | |
const int MAX = 100; | |
void printMatrix(int *m, int N) | |
{ | |
int i = 1; | |
for (int *ptr1 = m; ptr1 < m + N * N; ++ptr1, ++i) | |
{ | |
std::cout << *ptr1 << ' '; |
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
// Zad 2 | |
const num = 14; // input | |
let w = n * 2; // for width we need double of N | |
let h = 2 * n + 2; // height in problem description | |
for (let i = 0; i < h; i++) { | |
let row = ''; | |
// iterate each level | |
for (var j = 0; j < w; j++) { | |
// iterate width | |
if (i < n) { |
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 <string> | |
#include <iostream> | |
using namespace std; | |
struct Student | |
{ | |
string name; | |
string school; | |
double grade; |
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 <fstream> // std::ifstream, std::ofstream | |
using namespace std; | |
int main() | |
{ | |
int N, num, res; | |
streampos size; | |
ofstream outfile("new.txt", ios::out | ios::binary); | |
if (!outfile.is_open()) | |
{ |
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 <string> | |
using namespace std; | |
void toBin(int n) | |
{ | |
if (n == 0 || n == 1) | |
{ | |
cout << n; | |
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
void minMax(int arr[],int size) { | |
int min, max, minIdx, maxIdx; | |
for (int i = 0; i < size; i++) | |
{ | |
if (i == 0) { | |
// при първото завъртане, слагаме стойността на мин и макс като стойността на | |
// първия елемент на масива и прескачаме на следващото завъртане | |
min = max = arr[i]; | |
minIdx = maxIdx = 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> | |
#include <string> | |
#include <math.h> | |
using namespace std; | |
string decimalToBinary(unsigned int a) | |
{ | |
string b = ""; | |
if (a == 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> | |
using namespace std; | |
int main(int argc, const char * argv[]) { | |
int N, t, a,b,c; | |
int Nmax = 1000000; // po uslovie N ne moje da e poveche ot tova chislo | |
int tMax = 10000; // vs chislo sled N ne moje da e poveche ot tova | |
cin >> N; | |
cout << "N is: " << N << "\n"; |
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
public static void main(String[] args) { | |
int noOfRows = 1234; | |
for (int i = 0; i < noOfRows; i++) { | |
if (i > 0 && i % 18 == 0) { | |
System.out.println(1); | |
} | |
} | |
} |
NewerOlder