Skip to content

Instantly share code, notes, and snippets.

View MohamedTaha98's full-sized avatar

MohamedTaha98

View GitHub Profile
#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;
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void)
{
string s, t;
while(cin >> s)
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <valarray>
#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);
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();
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
long L, S1, S2, Q;
cin >> L >> S1 >> S2;
cin >> Q;
#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",
#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;
// 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;
}
/**
* Copies a BMP piece by piece, just because.
*/
#include <stdio.h>
#include <stdlib.h>
#include "bmp.h"
int main(int argc, char *argv[])