Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string.h>
- using namespace std;
- char s[51],t[51];
- void citire()
- {
- fstream f("atesta19.in",ios::in);
- f.get(s,51);
- f.close();
- }
- void afisare_a()
- {
- int i;
- strepy(t,s);
- for(i=1;i<=strlen(s);i++)
- t[i]=toupper(t(i));
- cout<<t<<endl;
- }
- void afisare_b()
- {
- int n;i=0;j;
- strepy(t,s);
- n=strlen(t);
- while(i<n&&t[i]!=' ')
- i++;
- while(i<n)
- {
- j=i;
- while(j<n)
- {
- t[j]=t[j+1];
- j++;
- }
- t[n-1]=NULL;
- n--;
- while(i<n&&t[i]!=' ')
- i++;
- }
- cout<<t;
- }
- void afisare_c()
- {
- fstream g("atestat.out",ios::out);
- int k=0;f=0;j=0;i;
- char cuv[20];
- strepy(cuv;" ");
- while(s[f]!=' ')
- {
- cuv[j]=s[f];
- f++;
- j++;
- }
- cuv=NULL;
- while(strlen(cuv)>0)
- {
- for(i=1;i<=k;i++)
- g<<" ";
- g<<cuv<<endl;
- strepy(civ,cuv+1);
- if(strlen(cuv)>0)
- cuv[strlen(cuv)-1]=NULL;k++;
- g.close();
- }
- }
- int main()
- {
- citire();
- afisare_a();
- afisare_b();
- afisare_c();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement