Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <cstdlib>
  5. using namespace std;
  6. void barcode()
  7. {
  8. int b=0;
  9. int size=100;
  10. int barcodes[size], kodas, sum=0;
  11. string foodname[size];
  12. float price[size];
  13. ifstream barcodefile("barkodai.txt");
  14. cout<<"iveskite bar koda"<<endl;
  15. bool baigtidarba=false;
  16. while(!barcodefile.eof())
  17. {
  18. barcodefile>>foodname[b]>>barcodes[b]>>price[b];
  19. b++;
  20. }
  21. while(!baigtidarba){
  22. cin>>kodas;
  23. for(int i=0; i<size; i++)
  24. {
  25. if(kodas==barcodes[i]){
  26. cout<<"helloworld";
  27. i=size;
  28. }
  29. else
  30. baigtidarba==true;
  31. }
  32. }
  33. }
  34.  
  35. void ducument()
  36. {
  37.  
  38. string vardas, pavarde;
  39. int slaptazodis, pasw;
  40. ifstream failas("kasa.txt");
  41. cout<<"iveskite slaptazodi"<<endl;
  42. cin>>pasw;
  43.  
  44. while (failas>>vardas>>pavarde>>slaptazodis)
  45. {
  46.  
  47.  
  48. if(pasw==slaptazodis)
  49. {
  50. cout<<"sveiki prisijunge "<<vardas<<" "<<pavarde<<endl;
  51. break;
  52. }
  53. }
  54.  
  55. }//bool
  56. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  57. using namespace std;
  58. int main(int argc, char** argv) {
  59.  
  60. ducument();
  61. barcode();
  62.  
  63.  
  64.  
  65.  
  66.  
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement