Umut Ulus

Kişisel İnternet Günlüğü

#include<stdio.h>
#include<conio.h>
main()
{
int i,b[10],x,k=1,c,m[10][2],j=0,u=0,d,e;
for(i=0;i<10;i++)
{
printf(”%d.sayiyi yazin:”,i+1);
scanf(”%d”,&b[i]);
}
{printf(”\nyazilan sayi        tekrar mikrari\n”);
printf(”———–          ————-\n\n”);}
for(i=0;i<9;i++){
for(x=i+1;x<10;x++){

if(b[i]==b[x]){
c=b[x];
b[x]=b[i+1];
b[i+1]=c;}
}
} Read the rest of this entry »

Posted by Umut On Ekim - 26 - 2008 Programlama

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

#define FALSE 0

#define TRUE 1

#define REMOVED 10

void

swap(char *a, char *b)

{

char t = *a;

*a = *b;

*b = t;

}

void

init(char field[], int *pairsLeft, int *player)

{

int i, random;

srand((unsigned int) time(NULL));

for (i = 0; i < 10; ++i) {

field[2*i] = field[2*i+1] = i;

}

for (i = 0; i < 20; ++i) {

random = (int) ((20.0 – i) * (rand() / (RAND_MAX + 1.0)));

swap(field + i, field + i + random);

}

*pairsLeft = 10;

*player = 0;

}

void

displayField(char field[], int turned, int turnedIndex[])

{

int turnThis = FALSE;

int i, j, k;

for (i = 0; i < 6; ++i) {

printf(”\n\n\n\n\n\n\n\n\n\n”);

}

printf(”     0   1   2   3   4\n”);

printf(”   +—+—+—+—+—+\n”);

for (i = 0; i < 4; ++i) {

printf(” %d |”, i);

for (j = 0; j < 5; ++j) {

if (*field != REMOVED) {

turnThis = FALSE;

for (k = 0; k < turned; ++k) {

if ((i == turnedIndex[2*k]) && (j == turnedIndex[2*k+1])) {

turnThis = TRUE;

break;

}

}

if (turnThis == TRUE) {

printf(” %d |”, *field);

} else {

printf(” # |”);

} Read the rest of this entry »

Posted by Umut On Ekim - 26 - 2008 Programlama

#include<stdio.h>

#include<conio.h>

int matrisa[3][3]={5,2,7,4,9,6,7,4,1};

int matrisb[3][3]={6,7,4,9,8,2,3,4,9};

int carpmatris[3][3]={0,0,0,0,0,0,0,0,0};

int i,j;

int main(){

for (i=0;i<3;i++){

for (j=0;j<3;j++){

carpmatris[i][j]=matrisa[i][j]*matrisb[i][j];

}

}

for (i=0;i<3;i++){

for (j=0;j<3;j++){

printf(”%d     “,carpmatris[i][j]);

}

printf(”\n\n\n”);

} Read the rest of this entry »

Posted by Umut On Ekim - 26 - 2008 Programlama

#include<iostream>

using std::cout;

using std::cin;

using std::endl;

#include<iomanip>

using std::setw;

#include<ctime>

int isPresent(int * arr, int uBound , int v)

{

int i = 0 ;

while( i < uBound)

{

if (*(arr+i) == v )

return i;

i++;

}

return -1;

}

int main()

{

int a=0,b[6];

srand(time(0));

cout<<endl<<endl<<setw(40)<<”SAYISAL LOTO”<<endl<<endl<<setw(46)<<”  Created by UMUT ULUS “<<endl<<endl;

cout<<setw(50)<<” Programi kapatmak  icin -1 girin “<<endl<<endl;

int v ;

int j;

while(a!=-1)

{

cout<<setw(50)<<” Programi kapatmak  icin -1 girin “<<endl;

cout<<setw(44)<<”     Kac kolon oynayacaksin ? : “;

cin>>a;

cout<<endl<<endl;

for(int i=1;i<=a;i++)

{

for(j = 0;j<6;j++)

{

v = rand()%49+1;

while( isPresent(b,j,v) >= 0 )

v = rand()%49+1;

b[j] = v;

}

cout<<setw(18)<<i<<”. Kolon : “<<setw(5);

for(int l=0;l<6;l++)

{

cout<<setw(5)<<b[l];

}

cout<<endl<<endl<<endl;

}

}

return 0;

}

Posted by Umut On Ekim - 26 - 2008 Programlama

Rss Besleme

Video

Etiketler

Porno İzle