Facebook
From asd, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 206
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  6.  
  7. int main(int argc, char *argv[]) {
  8.  
  9.                 /*
  10.                 double a,x,b=7.5,c;
  11.                
  12.                 printf("Podaj x\n");
  13.                 scanf("%lf",&x);
  14.                 printf("Podaj c\n");
  15.                 scanf("%lf",&c);
  16.                
  17.                 a=sqrt(pow(c,2)+pow(b,2));
  18.                 printf("a=%lf\n",a);
  19.                 */
  20.                
  21.                 /*
  22.                 double y,x,b=7.5,c;
  23.        
  24.                 printf("Podaj c\n");
  25.                 scanf("%lf",&c);
  26.                 printf("Podaj x\n");
  27.                 scanf("%lf",&x);
  28.                
  29.                 y=2*pow(x,4)+b*pow(x,3)+c*pow(x,2)+8;
  30.                 printf("y=%lf\n",y);
  31.                 */
  32.                
  33.                 /*
  34.                 double y,x;
  35.                
  36.                 printf("Podaj x\n");
  37.                 scanf("%lf",&x);
  38.                
  39.                 y=pow(((1/3.0+sin(x/2.0))*(pow(x,3.0)+3.0)),(1/3.0));
  40.                
  41.                 printf("y=%lf\n",y);
  42.                 */
  43.                
  44.                 /*
  45.                 double y,x;
  46.                
  47.                 printf("Podaj x\n");
  48.                 scanf("%lf",&x);
  49.                
  50.                 y=pow(((1/3.0+sin(x/2.0))*(pow(x,3.0)+3.0)),(1/5.0));
  51.                
  52.                 printf("y=%lf\n",y);
  53.                 */
  54.                
  55.                 /*
  56.                 double x,z;
  57.                
  58.                 printf("Podaj x\n");
  59.                 scanf("%lf",&x);
  60.                
  61.                 z=(sqrt(x+2)/(3*pow(x,2)-7*x+2));
  62.                
  63.                 printf("z=%lf\n",z);
  64.                 */
  65.                
  66.                 /*
  67.                 double x,a,b;
  68.                
  69.                 printf("Podaj a\n");
  70.                 scanf("%lf",&a);
  71.                 printf("Podaj b\n");
  72.                 scanf("%lf",&b);
  73.                         if(a==0)
  74.                         {
  75.                                 printf("brak m0\n");
  76.                         }else
  77.                         {
  78.                         x=(-b/a);
  79.                         printf("miejsce zerowe to: %lf",x);
  80.                         }
  81.                         */
  82.                         /*
  83.                 double y,x;
  84.                
  85.                 printf("Podaj x\n");
  86.                 scanf("%lf",&x);
  87.                 if(x<0)
  88.                 {
  89.                         y=sqrt(fabs(2+x));
  90.                 }else
  91.                 {
  92.                         if(x==0)
  93.                         {
  94.                                 y=2;
  95.                         }else
  96.                         {
  97.                                 y=pow(x,2)+pow(M_E,2*x);
  98.                         }
  99.                 }
  100.                 printf("y=%lf",y);
  101.                 */
  102.                 /*     
  103.                 double y,x;
  104.                
  105.                 printf("Podaj x\n");
  106.                 scanf("%lf",&x);
  107.                 if(x<=-5)
  108.                 {
  109.                         y=2*x+10/3.0;
  110.                 }else
  111.                 {
  112.                         if(x>=7)
  113.                         {
  114.                                 y=pow((sin(2*x)+pow(x,2)),(1.0/3));
  115.                         }else
  116.                         {
  117.                                 y=sqrt(fabs(x))+pow(M_E,x/2.0+1);
  118.                         }
  119.                 }
  120.                         printf("y=%lf",y);
  121.                         */
  122.                         /*
  123.                 double y,x;
  124.                
  125.                 printf("Podaj x\n");
  126.                 scanf("%lf",&x);
  127.                 if(1<=x<=7)
  128.                 {
  129.                         y=pow(2*x+(1.0/4),(1.0/4));
  130.                 }else
  131.                 {
  132.                         y=cos(pow(M_E,2*x));   
  133.                 }
  134.                         printf("y=%lf",y);
  135.                         */
  136.                
  137.                 /*
  138.                 double a,b,c,x,d,x1,x2;
  139.                 printf("Podaj a\n");
  140.                 scanf("%lf",&a);
  141.                 printf("Podaj b\n");
  142.                 scanf("%lf",&b);
  143.                 printf("Podaj c\n");
  144.                 scanf("%lf",&c);
  145.                 d=pow(b,2)-4*a*c;
  146.                 if(d>0)
  147.                 {
  148.                 x1=(-b-sqrt(d))/2*a;
  149.                 x2=(-b+sqrt(d))/2*a;
  150.                 printf("x1:%lf,\tx2:%lf\n",x1,x2);
  151.                 }else
  152.                 {
  153.                         if (d=0)
  154.                         {
  155.                                 x1=-b/2*a;
  156.                                 printf("x1:%lf\n",x1);
  157.                         }else
  158.                         {
  159.                                 printf("Brak rozwiazan");
  160.                          }
  161.                        
  162.                 }
  163.                
  164.                 */
  165.                        
  166.                
  167.                 /*
  168.                 double a11,a12,a21,a22,b1,b2,x,y,w,wx,wy;
  169.        
  170.                 printf("Podaj a11\n");
  171.                 scanf("%lf",&a11);
  172.                 printf("Podaj a12\n");
  173.                 scanf("%lf",&a12);
  174.                 printf("Podaj a21\n");
  175.                 scanf("%lf",&a21);
  176.                 printf("Podaj a22\n");
  177.                 scanf("%lf",&a22);
  178.                 printf("Podaj b1\n");
  179.                 scanf("%lf",&b1);
  180.                 printf("Podaj b2\n");
  181.                 scanf("%lf",&b2);
  182.                
  183.                 wx=a22*b1-a12*b2;
  184.                 wy=a11*b2-a21*b1;
  185.                 w=a11*a22-a12*a21;
  186.                 printf("wx=%lf\n",wx);
  187.                 printf("wy=%lf\n",wy);
  188.                 printf("w=%lf\n",w);
  189.                
  190.                 if(w!=0)
  191.                 {
  192.                         x=wx/w;
  193.                         y=wy/w;
  194.                         printf("x=%lf\n",x);
  195.                         printf("y=%lf\n",y);
  196.                                                
  197.                 }else
  198.                 {
  199.                
  200.                 if(wx==0 && wy==0)
  201.                 {
  202.                         printf("Tozsamosciowe\n");
  203.                 }if(wx!=0 && wy!=0)
  204.                 {
  205.                         printf("Sprzeczne\n");
  206.                 */
  207.                
  208.        
  209.                
  210.  
  211.         return 0;
  212. }