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
// Copyright BDH Lab 2018 | |
#include <iostream> | |
#include <string> | |
using std::cout; | |
using std::string; | |
// IO class | |
class IO { | |
string output; |
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> | |
#define W 3 | |
#define H 2 | |
void inputMatrix (int matrix[H][W]) { | |
int i, j; | |
for (i = 0; i < H; i++) { | |
for (j = 0; j < W; j++) { | |
scanf("%d", &matrix[i][j]); | |
} |
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> | |
// 1 2 3 4 5 | |
// 1 3 4 5 -1 | |
void deleteItem (int list[], int z, int index) { | |
int i = index; | |
while (i < z) { | |
if ((i + 1) < z) // if there's an item on the left | |
list[i] = list[i + 1]; | |
else |
NewerOlder