Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <stdio.h>
- /////////////////////////////////////////////////////////
- class Acc
- {
- public:
- static int nCounter;
- int nBal;
- char szName[99];
- int add ();
- int take();
- void info ();
- };
- int Acc::nCounter = 0;
- /////////////////////////////////////////////////////////
- int main()
- {
- Acc p[99];
- char szName[99];
- printf("Vvedite imya: "); scanf("%s", szName);
- strcpy (p[1].szName, szName);
- p[1].nBal = p[1].add();
- printf(" Balans: %d\n", p[1].nBal);
- p[1].nBal = p[1].nBal - p[1].take();
- printf(" Balans: %d\n", p[1].nBal);
- p[1].info();
- return 0;
- }
- //////////////////////////////////////////////////////////////////
- int Acc::add()
- {
- int a;
- printf("Vvedite balans:");
- scanf("%d", &a);
- return a;
- }
- /////////////////////////////////////////////////////////////////
- int Acc::take()
- {
- int a;
- printf("Vvedite skollo hotite snyat:");
- scanf("%d", &a);
- return a;
- }
- /////////////////////////////////////////////////////////////////
- void Acc::info()
- {
- printf(" Name: %s\n", szName);
- printf("Balans: %d\n", nBal );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement