//devC++ da hazırladım kopyala ve caliştır acıkcası karmaşık bir dizin kullanmadım bence geliştirilmesi lazım fikirlere acığım.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define XXX 10
main()
{
char batch1[XXX],batch2[XXX],batch3[XXX],batch4[XXX];
int x,y,z,t;
float n;
char c,m,k,o=37;
//printf("renkleri aralarında bosluk birakarak girin...\n");
puts("not:harfleri ingiliz alfabesini dikkate alarak girin...a");
//scanf("%s%s%s%s",batch1,batch2,batch3,batch4);
do{
BAS:
printf("renkleri aralarinda bosluk birakarak girin...\n\n::::=>");
scanf("%s%s%s%s",batch1,batch2,batch3,batch4);
if(batch1[0]=='s'&&batch1[1]=='i')
x=0;
if(batch1[0]=='k'&&batch1[1]=='a')
x=1;
if(batch1[0]=='k'&&batch1[1]=='i')
x=2;
if(batch1[0]=='t'&&batch1[1]=='u')
x=3;
if(batch1[0]=='s'&&batch1[1]=='a')
x=4;
if(batch1[0]=='y'&&batch1[1]=='e')
x=5;
if(batch1[0]=='m'&&batch1[1]=='a')
x=6;
if(batch1[0]=='m'&&batch1[1]=='o')
x=7;
if(batch1[0]=='g'&&batch1[1]=='r')
x=8;
if(batch1[0]=='b'&&batch1[1]=='e')
x=9;
if(batch1[0]=='g'&&batch1[1]=='ü')
x=0;
if(batch1[0]=='a'&&batch1[1]=='l')
x=0;
if(batch2[0]=='r'&&batch2[1]=='e')
x=0;
if(batch2[0]=='s'&&batch2[1]=='i')
y=0;
if(batch2[0]=='k'&&batch2[1]=='a')
y=1;
if(batch2[0]=='k'&&batch2[1]=='i')
y=2;
if(batch2[0]=='t'&&batch2[1]=='u')
y=3;
if(batch2[0]=='s'&&batch2[1]=='a')
y=4;
if(batch2[0]=='y'&&batch2[1]=='e')
y=5;
if(batch2[0]=='m'&&batch2[1]=='a')
y=6;
if(batch2[0]=='m'&&batch2[1]=='o')
y=7;
if(batch2[0]=='g'&&batch2[1]=='r')
y=8;
if(batch2[0]=='b'&&batch2[1]=='e')
y=9;
if(batch2[0]=='g'&&batch2[1]=='ü')
y=0;
if(batch2[0]=='a'&&batch2[1]=='l')
y=0;
if(batch2[0]=='r'&&batch2[1]=='e')
y=0;
if(batch3[0]=='s'&&batch3[1]=='i')
{
z=1;
t=(10*x+y)*z;
c=95;
}
if(batch3[0]=='k'&&batch3[1]=='a')
{
z=10;
t=(10*x+y)*z;
c=95;
}
if(batch3[0]=='k'&&batch3[1]=='i')
{
z=100;
t=(10*x+y)*z;
c=95;
}
if(batch3[0]=='t'&&batch3[1]=='u')
{
z=1;//1000
t=(10*x+y)*z;
c=107;
}
if(batch3[0]=='s'&&batch3[1]=='a')
{
z=10;
c=107;//10 000
t=(10*x+y)*z;
}
if(batch3[0]=='y'&&batch3[1]=='e')
{
z=100;
c=107;//100 000
t=(10*x+y)*z;
}
if(batch3[0]=='m'&&batch3[1]=='a')
{
z=1;//1000 000
t=(10*x+y)*z;
c=109;
}
if(batch3[0]=='m'&&batch3[1]=='o')
{
z=10;
t=(10*x+y)*z;
c=109;
}
if(batch3[0]=='g'&&batch3[1]=='r')
{
z=100;
t=(10*x+y)*z;
c=109;
}
if(batch3[0]=='b'&&batch3[1]=='e')
{
z=1000;
t=(10*x+y)*z;
c=109;
}
if(batch4[0]=='s'&&batch4[1]=='i')
{
m=241;
n=0;
}
if(batch4[0]=='k'&&batch4[1]=='a')
{
m=241;
n=1;
}
if(batch4[0]=='k'&&batch4[1]=='i')
{
m=241;
n=2;
}
if(batch4[0]=='t'&&batch4[1]=='u')
{
m=241;
n=0;
}
if(batch4[0]=='s'&&batch4[1]=='a')
{
m=241;
n=0;
}
if(batch4[0]=='y'&&batch4[1]=='e')
{
m=241;
n=0.5;
}
if(batch4[0]=='m'&&batch4[1]=='a')
{
m=241;
n=0.25;
}
if(batch4[0]=='m'&&batch4[1]=='o')
{
m=241;
n=0.10;
}
if(batch4[0]=='g'&&batch4[1]=='r')
{
m=241;
n=0.05;
}
if(batch4[0]=='b'&&batch4[1]=='e')
{
m=241;
n=0;
}
if(batch4[0]=='g'&&batch4[1]=='u')
{
m=241;
n=10;
}
if(batch4[0]=='a'&&batch4[1]=='l')
{
m=241;
n=10;
}
if(batch4[0]=='r'&&batch4[1]=='e')
{
m=241;
n=20;
}
printf("[(%d_%cohm)]...ve hesaplamada direnclerin tolerans degerinden kaynaklanan\n ",t,c);
printf("[(%c %c%0.2f)] lik bir hata payi ile isleminiz tamamlanmistir.\n",m,o,n);
puts("---------------------------------------------");
//printf("yeni hesaplama yapmak icin 'e' ye bas... ");
//scanf("%c",&k);
}while(1);
getch();
return 0;
}
Konuyu Favori Sayfanıza Ekleyin