Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <stdio.h>
- #include <string.h>
- using namespace std;
- string a[1000],b[1000];
- int zodis=0,i;
- void nuskaito_faila ()
- {
- ifstream nuskaito;
- nuskaito.open("C:\\Users\\Mantas\\Desktop\\failas.txt");
- while (!nuskaito.eof())
- {
- nuskaito>>a[zodis];
- zodis++;
- }
- nuskaito.close();
- }
- void tikrina()
- {
- int j=0;
- for(i=0;i<zodis;i++)
- {
- if(a[i].find_first_of("Aa")==string::npos)
- {
- b[j]=a[i];
- j++;
- }
- }
- }
- void rikiuoja ()
- {
- string laik;
- for (int n=0; n<zodis;n++)
- {
- for(int j=n+1;j<=zodis;j++)
- {
- if ((strcmp(a[n],a[j])>0)
- {
- laik=a[n];
- a[n]=a[j];
- a[j]=laik;
- }
- }
- }
- int main()
- {
- nuskaito_faila();
- tikrina();
- for (i=0;i<zodis;i++)
- cout <<b[i]<<endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement