#include<iostream.h>Kod:Direncin degerini hesaplayan basit bir program
#include<string.h>
#include<math.h>
#include<time.h>
#include<stdlib.h>
void wait ( int seconds )
{
clock_t endwait;
endwait = clock () + seconds * CLOCKS_PER_SEC ;
while (clock() < endwait) {}
}
main()
{
char a[11],b[11],c[11];
int i,k,l,top=1,s,n;
char re[][12]={"siyah","kahverengi","kirmizi","turuncu","sari", "yeþil","mavi","mor","gri","beyaz"};
for (n=4; n>0; n--)
{
cout<<"\n\n\n\t\t\t\t"<<n<<endl;
cout<<"\t\t\tPROGRAMA YONLENDIRILIYORSUNUZ..."<<endl;
wait (1);system("cls");
}
cout<<"\n\n";
time_t longtime;
time(&longtime);
cout<<ctime(&longtime)<<endl;
cout<<"direncin sirasiyla renklerini giriniz"<<endl;
cin>>a;
cin>>b;
cin>>c;
for(i=0;i<10;i++){
if(!strcmp(a,re[i]))
cout<<i;}
for(k=0;k<10;k++){
if(!strcmp(b,re[k]))
s=k;}
for(l=0;l<10;l++)
if(!strcmp(c,re[l]))
top=pow(10,l);
cout<<s*top<<" ohm"<<endl;
}


TUĞGENERAL



Alıntı ile Cevapla
Bu Konuyu Paylaşın !