#include <stdio.h>
#include <math.h>
int main()
{
start:
float r,p,s,a,b,c,z;
printf("---------------------------------------------\n");
printf("adad ha ra be in shekl vared konid:x,y,z\n");
printf("_____________________________________________\n");
printf("please input three number");
scanf("%f,%f,%f",&a,&b,&c);
if (a+b<c)
goto end;
if (a+c<b)
goto end;
if(b+c<a)
goto end;
//-------------------
if (a+b>c)
goto end2;
if (a+c>b)
goto end2;
if(b+c>a)
goto end2;
end:
printf("tashkil mosallas nemidahand\n");
goto start;
return 0;
end2:
p=(a+b+c)/2;
z=p*(p-a)*(p-b)*(p-c);
s=sqrt(z);
r=s/p;
if (p<=a|p<=b|p<=c){
printf("\n");
printf("tashkil mosallas nemdahad\n");
printf("\n");}
else{
printf("\n");
printf("--------------tashkil mosallas midahand---------\n");
printf("\n");
printf("r=%f\n",r);
printf("\n");}
goto start;
return 0;
}
#include <iostream>
#include <cstdio>
#include <conio.h>
using namespace std;
int main()
{
cout<<"\a";
program:
cout<<"Please enter a hydrocarbon :";
char hc[40];
gets(hc);
int placeofh=-1,placeofc=-1,h=0,c=0;
for(int i=0;i<strlen(hc);i++)
{
if((hc[I]=='c')||hc[I]=='C')
placeofc=i;
else if((hc[I]=='h')||hc[I]=='H')
placeofh=i;
}
int x=placeofh-placeofc;
int y=strlen(hc)-placeofh;
char numofc[x],numofh[y];
for(int i=placeofc+1;i<=placeofh;i++)
{
numofc[i-placeofc-1]=hc[I];
}
for(int i=placeofh+1;i<strlen(hc);i++)
{
numofh[i-placeofh-1]=hc[I];
}
if(placeofh!=-1) h=atoi(numofh);
if(placeofh == strlen(hc)-1) h=1;
c=atoi(numofc);
if(placeofc == placeofh-1) c=1;
if(!strlen(hc))
{
cout<<"\nWhy didn't you enter anything?";
}
else if(h>4*c)
{
cout<<"\nThis is not a hydrocarbon,too few carbons and too many hydrogens!";
}
else if((h+4*c)%2)
{
cout<<"\nThis hydrocarbon is impossible!";
}
else
{
cout<<"\nThis hydrocarbon may be possible!";
}
getch();
cout<<"\a\n\n\n";
goto program;
return 0;
}
#include <stdio.h>
#include <math.h>
int main()
{
start:
float r,p,s,a,b,c,z;
printf("---------------------------------------------\n");
printf("adad ha ra be in shekl vared konid:x,y,z\n");
printf("_____________________________________________\n");
printf("please input three number");
scanf("%f,%f,%f",&a,&b,&c);
if (a+b<c)
goto end;
if (a+c<b)
goto end;
if(b+c<a)
goto end;
//-------------------
if (a+b>c)
goto end2;
if (a+c>b)
goto end2;
if(b+c>a)
goto end2;
end:
printf("tashkil mosallas nemidahand\n");
goto start;
return 0;
end2:
p=(a+b+c)/2;
z=p*(p-a)*(p-b)*(p-c);
s=sqrt(z);
r=s/p;
if (p<=a|p<=b|p<=c){
printf("\n");
printf("tashkil mosallas nemdahad\n");
printf("\n");}
else{
printf("\n");
printf("--------------tashkil mosallas midahand---------\n");
printf("\n");
printf("r=%f\n",r);
printf("\n");}
goto start;
return 0;
}
#include <stdio.h>
#include <conio.h>
int main()
{
start:
float fact;
int i,num;
for(;;){
printf("\n type a number:");
scanf("%d",&num);
{
if (num>20)
goto end;
if (num<1)
goto end;
if (0<num<20)
fact=1;
for(i=1;i<=num;i++)
fact*=i;
printf("factorial is :%f",fact);}
}
end:
printf("input one 0<number<21");
goto start;
return 0;
}