Facebook
From MD HABIBUR RAHMAN JESAN, 1 Month ago, written in C.
Embed
Download Paste or View Raw
Hits: 202
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int kotobar;
  5.     float price;
  6.     int code, koyta;
  7.     scanf("%d", &kotobar;);
  8.     while (kotobar--)
  9.     {
  10.         scanf("%d %d", &code;, &koyta;);
  11.         if (code == 1001)
  12.             price += koyta * 1.50;
  13.         else if (code == 1002)
  14.             price += koyta * 2.50;
  15.         else if (code == 1003)
  16.             price += koyta * 3.50;
  17.         else if (code == 1004)
  18.             price += koyta * 4.50;
  19.         else if (code == 1005)
  20.             price += koyta * 5.50;
  21.     }
  22.     printf("%.2f\n", price);
  23.     return 0;
  24. }