Facebook
From asd, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 196
  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.                 x1=(-b-sqrt(d))/2*a;
  147.                 x2=(-b+sqrt(d))/2*a;
  148.                 printf("x1:%lf,\tx2:%lf\n",x1,x2);
  149.                
  150.                 */
  151.                        
  152.                
  153.                 /*
  154.                 double a11,a12,a21,a22,b1,b2,x,y,w,wx,wy;
  155.        
  156.                 printf("Podaj a11\n");
  157.                 scanf("%lf",&a11);
  158.                 printf("Podaj a12\n");
  159.                 scanf("%lf",&a12);
  160.                 printf("Podaj a21\n");
  161.                 scanf("%lf",&a21);
  162.                 printf("Podaj a22\n");
  163.                 scanf("%lf",&a22);
  164.                 printf("Podaj b1\n");
  165.                 scanf("%lf",&b1);
  166.                 printf("Podaj b2\n");
  167.                 scanf("%lf",&b2);
  168.                
  169.                 wx=a22*b1-a12*b2;
  170.                 wy=a11*b2-a21*b1;
  171.                 w=a11*a22-a12*a21;
  172.                 printf("wx=%lf\n",wx);
  173.                 printf("wy=%lf\n",wy);
  174.                 printf("w=%lf\n",w);
  175.                
  176.                 if(w!=0)
  177.                 {
  178.                         x=wx/w;
  179.                         y=wy/w;
  180.                         printf("x=%lf\n",x);
  181.                         printf("y=%lf\n",y);
  182.                                                
  183.                 }else
  184.                 {
  185.                
  186.                 if(wx==0 && wy==0)
  187.                 {
  188.                         printf("Tozsamosciowe\n");
  189.                 }if(wx!=0 && wy!=0)
  190.                 {
  191.                         printf("Sprzeczne\n");
  192.                 */
  193.                
  194.        
  195.                
  196.  
  197.         return 0;
  198. }