This file contains hidden or 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
/*------------------------------------------------*/ | |
//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() |
This file contains hidden or 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> | |
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++){ |
This file contains hidden or 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
/*------------------------------------------------*/ | |
//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> |
This file contains hidden or 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
<?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; |
This file contains hidden or 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
/*------------------------------------------------*/ | |
// 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> |
This file contains hidden or 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> | |
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++){ |
This file contains hidden or 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
/*------------------------------------------------*/ | |
//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() |
This file contains hidden or 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
/*------------------------------------------------*/ | |
//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> |
This file contains hidden or 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> | |
int reverse(int n){ | |
int reversed=0; | |
while(n>0){ | |
reversed=10*reversed+(n%10); | |
n=n/10; | |
} | |
return reversed; | |
} |
This file contains hidden or 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<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 |