Guest User

Untitled

a guest
Nov 13th, 2021
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. #include<fstream>
  4. #include<windows.h>
  5.  
  6. using namespace std;
  7.  
  8. int main(void)
  9. {
  10.  
  11. int parameters_num = 2;
  12. string s;
  13. string arr[3][3] = {
  14.  
  15. {"022572", "Пр1", "25"},
  16. {"580216", "Пр2", "35"},
  17. {"003984", "Пр3", "45"}
  18.  
  19. };
  20.  
  21. fstream f;
  22. f.open("help.txt");
  23.  
  24. for (int y = 0; y <= 2; y++) {
  25.  
  26. for (int x = 0; x <= parameters_num; x++) {
  27. SetConsoleOutputCP(1251);
  28. switch (x)
  29. {
  30. case(0):
  31. {
  32. cout << "Штрих код - ";
  33. break;
  34. }
  35. case(1):
  36. {
  37. cout << "Имя - ";
  38. break;
  39. }
  40. case(2):
  41. {
  42. cout << "Цена - ";
  43. break;
  44. }
  45. }
  46.  
  47. cout << arr[y][x];
  48. if (x != 2) {
  49. cout << ", ";
  50. }
  51.  
  52. }
  53. cout << endl;
  54. }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment