Skip to content

Instantly share code, notes, and snippets.

View OmarJH's full-sized avatar

Omar alJubbah OmarJH

View GitHub Profile
@OmarJH
OmarJH / Sudoku solver.cpp
Last active December 21, 2015 14:59
Sudoku solver on c++ via console
#include <iostream>
#include <string>
using namespace std;
#include <windows.h>
HANDLE outcon = GetStdHandle(STD_OUTPUT_HANDLE);
bool end22 = false;
bool solved = false;
void gotoxy(short x, short y)
{
@OmarJH
OmarJH / List
Last active December 21, 2015 14:59
Simple List code (pointers)
#include <iostream>
using namespace std ;
void main ()
{
int *temp,start,*return_to_a ;
bool first= true;
cout<<"Please start entering numbers"<<endl;
while(1)
{
@OmarJH
OmarJH / ACM-Just The Facts
Last active August 29, 2015 14:14
ACM - 568 - Just the Facts -UVa Online Judge
#include <iostream>
#include<string>
using namespace std;
int main()
{
int N,Ans=1,Temp,i,f;
while (cin >> N)
{
Ans = 1;
@OmarJH
OmarJH / 150. Fibo
Created January 30, 2015 12:56
ACM _ 150. Fibo .....problem link : http://a2oj.com/p.jsp?ID=150
#include <iostream>
using namespace std;
int main()
{
int a[100002];
int N, t1 = 0, t2 = 1;
a[0] = 0;
a[1] = 1;
@OmarJH
OmarJH / 483 --Word Scramble
Last active August 29, 2015 14:16
ACM- 483 - Word Scramble - UVA Online Judge
#include<iostream>
#include<sstream>
#include<string>
using namespace std;
int main()
{
string line;
stringstream ss; // put the line into these stream to input words from it intead of cin
string word;
while (getline(cin, line)){
@OmarJH
OmarJH / TEX Quotes
Created February 25, 2015 14:39
ACM - 272 - TEX Quotes - UVA Online Judge
#include <iostream>
#include <string>
using namespace std;
int main()
{
string line;
bool counte=false;
int size;
while (getline(cin, line))
{
@OmarJH
OmarJH / A. Design Tutorial: Learn from Math
Created February 25, 2015 15:35
ACM _A. Design Tutorial: Learn from Math _CodeForces
#include <iostream>
using namespace std;
bool composite(int x)
{
for (int i = x / 2; i > 1; i--)
{
if (x%i == 0)
return true;
}
return false;
@OmarJH
OmarJH / Dreamoon and Stairs
Created February 25, 2015 16:07
ACM - 476A - Dreamoon and Stairs - CodeForces
#include <iostream>
using namespace std;
int main()
{
int x, n, m;
while (cin >> n >> m)
{
if (m > n)
x = -1;
else
@OmarJH
OmarJH / 10921 -Find the Telephone
Created February 27, 2015 12:09
ACM - 10921 -Find the Telephone _UVA Online Judge
#include <iostream>
#include <string>
using namespace std;
int main()
{
string line;
int size;
while (getline(cin, line))
{
size=line.size();
@OmarJH
OmarJH / 10921 -Find the Telephone
Created February 27, 2015 12:20
ACM_4736 - Probability One
#include <iostream>
using namespace std;
int main()
{
int x,i=0,f;
while (true)
{
cin >> x;
if (x == 0)
break;