Advertisement
Guest User

aasdasdsas

a guest
Oct 24th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.28 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. char bar[10][20];
  4. char jbar[10][200];
  5.  
  6. int no1; //IS IT FOR
  7. int no2;
  8. int pr1;
  9. int pr2;
  10.  
  11. int x;
  12. int y;
  13.  
  14. int main(){
  15.     for (x = 0; x<10; x++){
  16.         for (y = 0; y<20; y++){
  17.             bar[x][y] = '|';
  18.         }
  19.     }
  20.  
  21.     x = 0;
  22.     y = 0;
  23.  
  24.     for (x = 0; x<10; x++){
  25.         for (y = 0; y<200; y++){
  26.             jbar[x][y] = '|';
  27.         }
  28.     }
  29.  
  30.     for (no1 = 0; no1<3; no1++){
  31.         char bar1[20] = "";
  32.         char jbar1[200] = "";
  33.  
  34.         printf("Enter bar:\n");
  35.         gets_s(bar1);
  36.  
  37.         printf("\nEnter Quantity:\n");
  38.         gets_s(jbar1);
  39.  
  40.         for (no2 = 0; no2<20; no2++){
  41.             bar[no1][no2] = bar1[no2];
  42.         }
  43.  
  44.         for (pr1 = 0; pr1<200; pr1++){
  45.             jbar[no1][pr1] = jbar1[pr1];
  46.         }
  47.  
  48.     }
  49.     printf("=================================================================\n");
  50.     for (no1 = 0; no1<3; no1++){
  51.         printf("%d\t", no1 + 1); // 1 2 3
  52.  
  53.         for (no2 = 0; no2<20; no2++){
  54.             if (bar[no1][no2] == '|'){
  55.                 printf("");
  56.             }
  57.             else {
  58.                 printf("%c", bar[no1][no2]); // bar
  59.             }
  60.         }
  61.  
  62.         printf("\t");
  63.  
  64.         for (pr2 = 0; pr2<200; pr2++){
  65.             if (jbar[no1][pr2] == '|'){
  66.                 printf("T");
  67.             }
  68.             else {
  69.                 printf("%c", jbar[no1][pr2]); //quantity
  70.             }
  71.         }
  72.         printf("\n");
  73.  
  74.     }
  75.  
  76.     printf("=================================================================");
  77.     printf("%c", jbar[9][1]);
  78.  
  79.     getchar();
  80.     return 0;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement