Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string.h>
  4. using namespace std;
  5. char s[51],t[51];
  6. void citire()
  7. {
  8. fstream f("atesta19.in",ios::in);
  9. f.get(s,51);
  10. f.close();
  11. }
  12. void afisare_a()
  13. {
  14. int i;
  15. strepy(t,s);
  16. for(i=1;i<=strlen(s);i++)
  17. t[i]=toupper(t(i));
  18. cout<<t<<endl;
  19. }
  20. void afisare_b()
  21. {
  22. int n;i=0;j;
  23. strepy(t,s);
  24. n=strlen(t);
  25. while(i<n&&t[i]!=' ')
  26. i++;
  27. while(i<n)
  28. {
  29. j=i;
  30. while(j<n)
  31. {
  32. t[j]=t[j+1];
  33. j++;
  34. }
  35. t[n-1]=NULL;
  36. n--;
  37. while(i<n&&t[i]!=' ')
  38. i++;
  39. }
  40. cout<<t;
  41. }
  42. void afisare_c()
  43. {
  44. fstream g("atestat.out",ios::out);
  45. int k=0;f=0;j=0;i;
  46. char cuv[20];
  47. strepy(cuv;" ");
  48. while(s[f]!=' ')
  49. {
  50. cuv[j]=s[f];
  51. f++;
  52. j++;
  53. }
  54. cuv=NULL;
  55. while(strlen(cuv)>0)
  56. {
  57. for(i=1;i<=k;i++)
  58. g<<" ";
  59. g<<cuv<<endl;
  60. strepy(civ,cuv+1);
  61. if(strlen(cuv)>0)
  62. cuv[strlen(cuv)-1]=NULL;k++;
  63. g.close();
  64.  
  65. }
  66. }
  67. int main()
  68. {
  69. citire();
  70. afisare_a();
  71. afisare_b();
  72. afisare_c();
  73. return 0;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement