Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View RezaBidar's full-sized avatar
🎯
Focusing

reza RezaBidar

🎯
Focusing
View GitHub Profile
@RezaBidar
RezaBidar / a+b
Created April 3, 2015 18:07
simple acm solution
#include<iostream>
using namespace std ;
int main(){
while(cin >> a >> b){
cout << a + b << endl ;
}
}
@RezaBidar
RezaBidar / factors.cpp
Last active August 29, 2015 14:18
find factors
#include<iostream>
using namespace std ;
int main(){
int a , n , j , tmay = 0 , tedad = 0 ;
cin >> a ;
for( n = 2 ; n <= a && a > 1; n++){
@RezaBidar
RezaBidar / various_problem.cpp
Last active August 29, 2015 14:19
ali moosaei c++ problems
#include<iostream>
#include<cmath>
using namespace std ;
double degreeToRadian(double d){
// 1 degree = 0.01745329252 radian ;
return d * 0.01745329252 ;
}
long moadele1(int x, int a, int b){
@RezaBidar
RezaBidar / userinfo.c
Created April 27, 2015 06:00
gist for Davood Mirzaei ; run in dev c++ in C language
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int counter = 1 ;
char fname[50] , lname[50] , address[100] , shenasname[20];
float weight , height , w_sum = 0, h_sum = 0;
@RezaBidar
RezaBidar / e_cal.cpp
Created June 28, 2015 07:13
for davood mirzaii
#include<iostream>
using namespace std ;
int fact(int x){
if(x == 0) return 1 ;
return x * fact(x-1);
}
int main(){
int n ;
@RezaBidar
RezaBidar / student_input_validation.cpp
Last active November 17, 2015 16:05
write a program that get student information and validate inputs . if inputs was valid show success message otherwise show correct error message .
#include<iostream>
#include<string>
using namespace std;
bool isNameValid(string name){
int length = name.length(); // name.size() ; strlen(name.c_str);
if (length > 40 || length < 5)
return false;
else
@RezaBidar
RezaBidar / baran_binary.cpp
Created January 11, 2016 14:21
add 2 binary value
#include<iostream>
#include<cmath>
using namespace std;
int decimal_binary(int n) /* Function to convert decimal to binary.*/
{
int rem, i = 1, binary = 0;
while (n != 0)
{