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 <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <crypt.h> | |
#define _XOPEN_SOURCE | |
#define MAX_SIZE 5 | |
bool cracked = false; |
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 <algorithm> | |
using namespace std; | |
int main(void) | |
{ | |
string s, t; | |
while(cin >> s) |
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 <algorithm> | |
#include <sstream> | |
#include <iterator> | |
#include <queue> | |
#include <stack> | |
#include <set> | |
#include <map> | |
#include <valarray> |
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; | |
void read2Numbers(double &dNum1, double &dNum2); | |
int menu(); | |
bool sum(double dNum1, double dNum2, double &dResult); | |
bool sub(double dNum1, double dNum2, double &dResult); | |
bool multi(double dNum1, double dNum2, double &dResult); | |
bool divide(double dNum1, double dNum2, double &dResult); |
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
import java.util.*; | |
public class Psolving { | |
public static void main(String[] args) { | |
Scanner in = new Scanner (System.in); | |
long L = in.nextLong(); | |
long S1 = in.nextLong(); | |
long S2 = in.nextLong(); | |
int Q = in.nextInt(); | |
for (int i = 0; i < Q; i++) { | |
double q = in.nextDouble(); |
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 <cmath> | |
using namespace std; | |
int main() | |
{ | |
long L, S1, S2, Q; | |
cin >> L >> S1 >> S2; | |
cin >> Q; |
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 <cs50.h> | |
int search(char** students, char* student_name, int len); | |
int main(void) | |
{ | |
char* students[5] = { | |
"Ahmed", |
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; | |
/* Structure containing the number, the character, | |
and a pointer to the next node */ | |
struct node | |
{ | |
int n; char c; | |
node* next; |
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
// Djb2 hash function | |
unsigned long hash(char *str) { | |
unsigned long hash = 5381; | |
int c; | |
while ((c = *str++)) | |
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ | |
return hash % NUM_BUCKETS; | |
} |
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
/** | |
* Copies a BMP piece by piece, just because. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "bmp.h" | |
int main(int argc, char *argv[]) |
NewerOlder