Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstdlib>
- using namespace std;
- void barcode()
- {
- int b=0;
- int size=100;
- int barcodes[size], kodas, sum=0;
- string foodname[size];
- float price[size];
- ifstream barcodefile("barkodai.txt");
- cout<<"iveskite bar koda"<<endl;
- bool baigtidarba=false;
- while(!barcodefile.eof())
- {
- barcodefile>>foodname[b]>>barcodes[b]>>price[b];
- b++;
- }
- while(!baigtidarba){
- cin>>kodas;
- for(int i=0; i<size; i++)
- {
- if(kodas==barcodes[i]){
- cout<<"helloworld";
- i=size;
- }
- else
- baigtidarba==true;
- }
- }
- }
- void ducument()
- {
- string vardas, pavarde;
- int slaptazodis, pasw;
- ifstream failas("kasa.txt");
- cout<<"iveskite slaptazodi"<<endl;
- cin>>pasw;
- while (failas>>vardas>>pavarde>>slaptazodis)
- {
- if(pasw==slaptazodis)
- {
- cout<<"sveiki prisijunge "<<vardas<<" "<<pavarde<<endl;
- break;
- }
- }
- }//bool
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- int main(int argc, char** argv) {
- ducument();
- barcode();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement