Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <fstream>
  4. #include <string>
  5. #include <stdio.h>
  6. #include <string.h>
  7.  
  8. using namespace std;
  9.  
  10. string a[1000],b[1000];
  11. int zodis=0,i;
  12.  
  13. void nuskaito_faila ()
  14. {
  15. ifstream nuskaito;
  16. nuskaito.open("C:\\Users\\Mantas\\Desktop\\failas.txt");
  17. while (!nuskaito.eof())
  18. {
  19. nuskaito>>a[zodis];
  20. zodis++;
  21. }
  22. nuskaito.close();
  23. }
  24.  
  25. void tikrina()
  26. {
  27. int j=0;
  28. for(i=0;i<zodis;i++)
  29. {
  30. if(a[i].find_first_of("Aa")==string::npos)
  31. {
  32. b[j]=a[i];
  33. j++;
  34. }
  35. }
  36. }
  37.  
  38. void rikiuoja ()
  39. {
  40. string laik;
  41. for (int n=0; n<zodis;n++)
  42. {
  43. for(int j=n+1;j<=zodis;j++)
  44. {
  45. if ((strcmp(a[n],a[j])>0)
  46. {
  47. laik=a[n];
  48. a[n]=a[j];
  49. a[j]=laik;
  50. }
  51. }
  52. }
  53.  
  54. int main()
  55. {
  56. nuskaito_faila();
  57. tikrina();
  58. for (i=0;i<zodis;i++)
  59. cout <<b[i]<<endl;
  60.  
  61. system("PAUSE");
  62. return EXIT_SUCCESS;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement