Skip to content

Instantly share code, notes, and snippets.

View shohan4556's full-sized avatar
💻
Making things that does not Exists !!

Shohanur Rahaman shohan4556

💻
Making things that does not Exists !!
View GitHub Profile
@shohan4556
shohan4556 / hashmat the brave warrior
Created October 25, 2014 03:35
hashmat the brave warrior
/*------------------------------------------------*/
//Problem Setter: Shahriar Manzoor
//Uva Problem No: 10055
//Problem Name : Hashmat the Brave Warrior.
//Author : shohanur Rahaman
//University : City university
//E-mail : [email protected]
/*-----------------------------------------------*/
#include<stdio.h>
int main()
@shohan4556
shohan4556 / bubble sort algo
Created October 26, 2014 01:35
bubble sort algo
#include<stdio.h>
int main()
{
int n=0,i,j,k,ck,data[100];
while(scanf("%d",&n)!=EOF){
for(k=0;k<n;k++)
scanf("%d",&data[k]);
for(j=0;j<n-1;j++){
/*------------------------------------------------*/
//Problem Setter: Shahriar Manzoor
//Uva Problem No: 10071
//Problem Name : Back To The High School Physics
//Author : Shohanur Rahaman
//University : City University
//E-mail : [email protected]
//N.B: While Submit the code erase all the coments above
/*-----------------------------------------------*/
#include<stdio.h>
@shohan4556
shohan4556 / project euler 02
Created October 31, 2014 01:50
project euler 02
<?php
function sum_even_fibonacci($x = 100) {
// Find the sum of all the even terms in the Fibonacci sequence below $x.
$f = array(1, 1);
while($f[count($f) - 1] < $x) {
$f[] = $f[count($f) - 1] + $f[count($f) - 2];
}
foreach ($f as $t) {
if ($t % 2 == 0) {
$e[] = $t;
/*------------------------------------------------*/
// problem source: projecteuler.net
// Problem No: 02
//Problem Name : Even Fibonacci numbers
//Author : Shohanur Rahaman
//University : City University
//E-mail : [email protected]
//N.B: While Submit the code erase all the coments above
/*-----------------------------------------------*/
#include<stdio.h>
@shohan4556
shohan4556 / bubble sort in C
Created November 3, 2014 07:08
bubble sort in C
#include<stdio.h>
int main()
{
int n,data[50],i,j,swap=0,temp;
while(scanf("%d",&n)==1){
for(i=0;i<n;i++)
scanf("%d",&data[i]);
for(i=0;i<n-1;i++){
for(j=0;j<n-i-1;j++){
@shohan4556
shohan4556 / train swap uva 299 solution in C
Last active August 29, 2015 14:08
train swap uva 299 solution in C
/*------------------------------------------------*/
//Uva Problem No: 299
//Problem Name : Train Swapping
//Author : Shohanur Rahaman
//University : City University
//E-mail : [email protected]
//Problem Type: Sorting
/*-----------------------------------------------*/
#include<stdio.h>
int main()
/*------------------------------------------------*/
//Problem Setter: Gordon V. Cormack
//Uva Problem No: 11812
//Problem Name : Beat The Spread!
//Author : Shohanur Rahaman
//University : City University
//E-mail : [email protected]
//Problem Type : Math
/*-----------------------------------------------*/
#include<stdio.h>
@shohan4556
shohan4556 / project euler problem 04
Created November 10, 2014 02:23
project euler problem 04
#include<stdio.h>
int reverse(int n){
int reversed=0;
while(n>0){
reversed=10*reversed+(n%10);
n=n/10;
}
return reversed;
}
@shohan4556
shohan4556 / প্রোজেক্ট ইউলার প্রবলেম # 07
Created November 24, 2014 11:22
প্রোজেক্ট ইউলার প্রবলেম # 07
#include<stdio.h>
#include<math.h>
#define N 1000000
char p[N];
int main()
{
int i,j,root,k,nth_prime=0;
for(i=0;i<N;i++)
p[i]=1; // initialize array assume that all are prime