netjunky

Untitled

Oct 17th, 2010
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.    double S,H,K;
  5.    int A;
  6.    char V;
  7.    /* Operation sisestada S */
  8.    printf("Raha summa = ");
  9.    scanf("%lf",&S);
  10.    V='+';
  11.    while (S>0&&V=='+')
  12.    {  printf ("Kauba artikkel = ");
  13.       scanf("%d",&A);
  14.       do { printf("Kauba hind (positiivne) = ");
  15.            scanf("%lf",&H);
  16.           } while (H<0);
  17.       do { printf("Kauba kogus (positiivne) = ");
  18.            scanf("%lf",&K);
  19.           } while (K<0);
  20.       if (H*K<=S){S-=H*K;
  21.                   printf("Kaup on ostetud. Teil jдi %8.2lf EEK.\n",S);
  22.                  }
  23.       else
  24.          printf("Raha jдi puudu.\n");
  25.       printf("Kas soovite jдtkata? '+' vхi '-' ");
  26.       scanf("%c",&V);
  27.    };
  28.   printf("Kьlastage meid jдlle!");
  29. scanf("%c",&V);
  30. scanf("%c",&V);
  31. }
Add Comment
Please, Sign In to add comment