Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("date.in");
- struct nod
- {
- char info;
- nod *urm;
- };
- nod *p;
- void add(nod *&p, char x)
- {
- if(x)
- {
- nod *c=new nod;
- c->info=x;
- c->urm=p;
- p=c;
- }
- }
- void aff(nod *p)
- {
- while(p)
- {
- cout<<p->info<<" ";
- p=p->urm;
- }
- }
- int main()
- {
- char x;
- f>>x;
- while(x!='0')
- {
- add(p,x);
- f>>x;
- }
- aff(p);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement